XMGED - New Commands

# New Commands

## OPENDB

    	opendb database

Read a new database into mged. If the given database name does not exist, the user will be prompted to create a new database. If the user decides not to create a new database, the program is exited.

## CLOSEW

    	closew n

Close drawing area n.

## OPENW

    	openw [host]

Open a display connection for host. Host must be in the same format as would the DISPLAY environment variable. For example, host could be myMachine:0. If host is not provided, the user will be prompted to enter a host name.

## SV

    	sv x y

This command moves the view center to (x, y, 0).

## ALIAS

    	alias [alias_name [command(s) parameter(s)]]

This command, with no parameters, prints out a list of the currently defined aliases and their definitions. With one parameter, it prints out the definition of alias_name. Otherwise it defines alias_name to be that specified by the remainder of the command line. Parameters may be introduced by using $N anywhere in the definition. For example, to define an alias to make an arb8 using the ``make'' command, enter the following:

    	alias m8 make $1 arb8

To make an arb8 with the name new_arb8, the following command can now be entered:

    	m8 new_arb8

Multiple commands within the alias definition are separated with semi-colons. For example, to define another alias to make an arb8, solid edit the new arb by translating it to a new location and accept the edit, enter the following:

    	alias mse8 m8 $1; sed $1; press stran; p $2 $3 $4; press accept

To make an arb8 called moved_arb8 and reposition it to (10, 20, 30), you can now enter the following:

    	mse8 moved_arb8 10 20 30

As you can see, the use of aliases within another alias definition is allowed. However, recursive definitions are not allowed. For example, you can define an alias l (alias l l *) to list object information for all objects in the database, but you cannot do the following:

    	alias m7 make $1 arb7
    	alias marbs m7 $1; m8 $2
    	alias m8 marbs $1 $2

The semi-expanded definition of m8 is:

    	alias m8 m7 $1; m8 $2

Now if you enter: m8 a7 a8, an arb7 named a7 is created, but the command, m8 a8, is not recognized because the alias m8 has already been touched, so no substitution is made. That is, the command m8 a8 is executed as is, which of course is not a valid mged command.

## UNALIAS

unalias defined_alias This command undefines the alias defined_alias.

## HISTORY

    	history [N]

This command lists all of the previous commands or the last N commands if N is specified. Mged currently implements a subset of the csh history list recall facility with one caveat. The ``@'' character replaces ``!'' because mged uses ``!'' to execute a shell command. The following lists the implemented features:

    	@N	execute the Nth command
    	@@	execute the last command
    	@-N	execute the Nth command from last one
    	@str	execute the last command with ``str'' anywhere
    		in the command line

See a description of the MGED_HISTORY environment variable in the NEW ENVIRONMENT VARIABLES section.

## SAVEDIT

    	savedit

The ``save_edit'' command allows the user, while in the solid edit state, to save all edits and remain in the solid edit state.

## SOURCE

    	source command_file [option]

This command, with an option of 0, reads and adds the commands to the history list. If there is no option or an option of 1, the commands are read and executed but not added to the history list. If the option is 2, the commands are read, executed and added to the history list. See a description of the MGED_SRC_DIR environment variable in the NEW ENVIRONMENT VARIABLES section.

A sample source file with commands to build the Tin Woodsman from the MGED manual is found at the end of this document.

## JOURNAL

    	journal [file]

This command toggles journalling. When journalling is on, commands are written to a file that can later be executed via the source command. If the file name is not entered on the command line, a file name is chosen for you. For more information, see a description of the MGED_JOURNAL environment variable in the NEW ENVIRONMENT VARIABLES section.

## SLIDER

    	slider number value

This command simulates a slider adjustment and is intended to be used by mged when journalling. ``number'' refers to a particular slider and ``value'' refers to the slider's new position. The following is a list of slider numbers:

    	XSLEW/XTRAN:		0
    	YSLEW/YTRAN:		1
    	ZSLEW/ZTRAN:		2
    	ZOOM:			3
    	XROT:			4
    	YROT:			5
    	ZROT:			6
    	XADC:			7
    	YADC:			8
    	ANG1:			9
    	ANG2:			10
    	TICK:			11

## BUTTON

    	button number

This command simulates a button press and is intended to be used by mged when journalling. Number refers to a particular button. The following is a list of button numbers:

    LABEL                  NUMBER             LABEL                 NUMBER
    **********************************************************************
    arb4 move point 1:	0
    arb4 move point 2:	1		torus scale radius 1:	95
    arb4 move point 3:	2		torus scale radius 2:	96
    arb4 move point 4:	3
    arb4 move face 123:	4		ellipse scale A:	97
    arb4 move face 124:	5		ellipse scale B:	98
    arb4 move face 234:	6		ellipse scale C:	99
    arb4 move face 134:	7		ellipse scale A.B,C:	100
    arb4 rotate face 123:	8
    arb4 rotate face 124:	9		tgc scale H:		101
    arb4 rotate face 234:	10		tgc scale A:		102
    arb4 rotate face 134:	11		tgc scaleB:		103
    					tgc scale C:		104
    arb5 move edge 12:	12		tgc scale D:		105
    arb5 move edge 23:	13		tgc scale A,B:		106
    arb5 move edge 34:	14		tgc scaleC,D:		107
    arb5 move edge 14:	15		tgc scale A,B,C,D:	108
    arb5 move edge 15:	16		tgc rotate H:		109
    arb5 move edge 25:	17		tgc rotate AXB:		110
    arb5 move edge 35:	18		tgc move end H(rt):	111
    arb5 move edge 45:	19		tgc move end H:		112
    move point 5:		20
    arb5 move face 1234:	21		eto scale R:            113
    arb5 move face 125:	22		eto scale D:            114
    arb5 move face 235:	23		eto scale C:            115
    arb5 move face 345:	24		eto rotate C:           116
    arb5 move face 145:	25
    arb5 rotate face 1234:	26		rpc scale B:            117
    arb5 rotate face 125:	27		rpc scale H:            118
    arb5 rotate face 235:	28		rpc scale R:            119
    arb5 rotate face 345:	29
    arb5 rotate face 145:	30		rch scale B:            120
    					rch scale H:            121
    arb6 move edge 12:      31		rch scale R:            122
    arb6 move edge 23:      32		rch scale C:            123
    arb6 move edge 34:      33
    arb6 move edge 14:      34		epa scale H:            124
    arb6 move edge 15:      35		epa scale A:            125
    arb6 move edge 25:      36		epa scale B:            126
    arb6 move edge 36:      37
    arb6 move edge 46:      38		ehy scale H:            127
    arb6 move point 5:      39		ehy scale A:            128
    arb6 move point 6:      40		ehy scale B:            129
    arb6 move face 1234:    41		ehy scale C:            130
    arb6 move face 2365:    42
    arb6 move face 1564:    43		spline pick vertex:     131
    arb6 move face 125:     44		spline move vertex:     132
    arb6 move face 346:     45
    arb6 rotate face 1234:  46		object scale:		133
    arb6 rotate face 2365:  47		object X move:		134
    arb6 rotate face 1564:  48		object Y move:		135
    arb6 rotate face 125:   49		object XY move:		136
    arb6 rotate face 346:   50		object rotate:		137
    					object scale X:		138
    arb7 move edge 12:      51		object scale Y:		139
    arb7 move edge 23:      52		object scale Z:		140
    arb7 move edge 34:      53
    arb7 move edge 14:      54		solid rotate:		141
    arb7 move edge 15:      55		solid translate:	142
    arb7 move edge 26:      56		solid scale:		143
    arb7 move edge 56:      57
    arb7 move edge 67:      58		reject edit:		144
    arb7 move edge 37:      59		accept edit:		145
    arb7 move edge 57:      60		save edit:		146
    arb7 move edge 45:      61
    arb7 move point 5:      62		top:			147
    arb7 move face 1234:    63		bottom:			148
    arb7 move face 2376:    64		right:			149
    arb7 rotate face 1234:  65		left:			150
    arb7 rotate face 567:   66		front:			151
    arb7 rotate face 145:   67		rear:			152
    arb7 rotate face 2376:  68		45,45:			153
    arb7 rotate face 1265:  69		35,25:			154
    arb7 rotate face 4375:  70		restore view:		155
    					save view:		156
    arb8 move edge 12:      71		reset view:		157
    arb8 move edge 23:      72		sliders:		158
    arb8 move edge 34:      73		input win:		159
    arb8 move edge 14:      74
    arb8 move edge 15:      75		angdist curs:		160
    arb8 move edge 26:      76		solid illum:		161
    arb8 move edge 56:      77		object illum:		162
    arb8 move edge 67:      78		alt mouse mode:		163
    arb8 move edge 78:      79		multi views:		164
    arb8 move edge 58:      80		swap views:		165
    arb8 move edge 37:      81		zero sliders:		166
    arb8 move edge 48:      82		rate based:             167
    arb8 move face 1234:    83
    arb8 move face 5678:    84		help:                   168
    arb8 move face 1584:    85		Mged database file:     169
    arb8 move face 2376:    86		Postscript file:        170
    arb8 move face 1265:    87		Pix file:               171
    arb8 move face 4378:    88		Open:                   172
    arb8 rotate face 1234:  89		Insert:                 173
    arb8 rotate face 5678:  90		Info:                   174
    arb8 rotate face 1584:  91		Exit:                   175
    arb8 rotate face 2376:  92
    arb8 rotate face 1265:  93
    arb8 rotate face 4378:  94

up prev next