Editing Changing the properties of primitive objects

From BRL-CAD

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
MGED provides several different ways to modify and reposition [[BRL-CAD Primitives]] by changing the values of their associated parameters:
+
We have [[Determining the properties of primitives|determined the properties of a primitive object]]. From the [[mged]] console, we now wish to change the properties of this object. The following example demonstrates how to change the height of a [[right circular cylinder]].
  
* the [[#Primitive Editor | primitive object editor]] dialog box
+
The following command can be used to change the height of a [[right circular cylinder]] [[primitive object]]:
* the [[#Interactive editing | interactive editing]] commands
 
* the get and put [[#TCL Commands | TCL commands]]
 
  
See also: [[Determining the properties of primitive objects]]
 
;
 
  
= Primitive Editor =
 
  
Most of the parameters associated with many primitive objects can be edited using the '''Primitive Editor''' dialog box:
+
The parameters of many primitive objects can be edited using the Primitive Editor dialog box:
# Invoke the GUI '''Edit-->Primitive Editor''' command to display that dialog.
+
# Invoke the GUI '''Edit-->Primitive Editor''' command to display that form.
# Type the object's name into the '''Name:''' field and then click the '''Reset''' button to display its associated form and the current values of its editable parameters.  
+
# Type the object's name into the '''Name:''' field and then click the '''Reset''' button to display its current parameter values (and add it to the Display Window if it wasn't previously drawn there).  
# Interactively change and reposition the object by changing appropriate parameter values. Your changes are immediately written to the database and the object is redrawn in the Display Window each time you click the '''Apply''' or '''OK''' button (OK also closes the dialog box). Unapplied changes can be undone by clicking the '''Reset''' button.
+
# Interactively edit the object by changing various parameter values. Your changes are immediately written to the database and the Display Window is updated each time you click the '''Apply''' or '''OK''' button (OK also closes the dialog box). Unapplied changes can be undone by clicking the '''Reset''' button.
 
# Repeat the above steps to edit additional objects, or click the '''OK''' or '''Dismiss''' button to close the dialog.
 
# Repeat the above steps to edit additional objects, or click the '''OK''' or '''Dismiss''' button to close the dialog.
  
Note that forms have not been defined for all object types. Those that lack such forms cannot be edited using this method.
+
Alternately, any ''displayed'' primitive object can be selected for modification or relocation using either the GUI '''Edit-->Primitive Selection...''' or the CLI '''sed''' command. Objects that aren't currently displayed will not be listed in the Primitive Selection Menu dialog, and the sed command will display an error message if you attempt to select such an object. In either case, the object could then be selected after using the CLI '''draw''' or '''B''' command to display it,
  
= Interactive editing =
+
;Most parameters (including ones not editable from a form) have special items on the edit menu.
  
Any ''currently displayed'' primitive object can be selected for modification or relocation using either the GUI '''Edit-->Primitive Selection...''' or the CLI [[MGED CMD sed | '''sed''']] command.
+
Primitive objects can also be edited by using a TCL '''get''' command to view its current database entry, then '''kill''' that object and recreate it using a TCL '''put''' command.
  
Objects that aren't currently displayed will not be listed in the Primitive Selection Menu dialog, and the sed command will display an error message if you try to edit such an object. In either case, using the CLI '''draw''' or '''B''' command to display such an object would then allow you to select it for editing.
+
=For additional information=
 
 
When such an object is selected for editing, the '''Edit''' menu will display a set of commands specific to the corresponding primitive type. Invoking any such command will allow you to change the corresponding parameter(s) by entering CLI '''p''' commands or activating the Graphics Window and using associated '''shift grip''' mouse actions. Similarly, the CLI will enable various edit-mode commands that can be used to modify or relocate the selected primitive. As you use either approach to make such changes, you can:
 
* record the changes you have made so far by invoking the GUI '''Edit-->Apply''' or entering the CLI '''apply''' command;
 
* undo any unrecorded changes by invoking the GUI '''Edit-->Reset''' or entering the CLI '''reset''' command;
 
* record the changes you have made and return to viewing mode by invoking the GUI '''Edit-->Accept''' or entering the CLI '''accept''' command; or
 
* discard any unrecorded changes and return to the viewing mode by invoking the GUI '''Edit-->Reject''' or entering the CLI '''reject''' command. You can also reject unrecorded changes by pressing the escape key while the Graphics Window is active.
 
 
 
= TCL Commands =
 
 
 
Although it is a cumbersome approach that is best reserved for scripted editing, primitive objects can also be edited by entering TCL '''get''' and '''put''' commands via the CLI:
 
# Enter a "get object_name" command to display the current database entry for that object.
 
# Enter a "kill object_name" command to delete that database entry and erase the object from the Graphics Window.
 
# Enter a "put object_name properties" command to recreate that object with modified parameter values.
 
# Enter a "draw object_name" command to redisplay the object and verify your changes.
 

Please note that all contributions to BRL-CAD may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see BRL-CAD:Copyrights for details). Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)