pt (Optional)
A 2D or 3D point to be used as the base point in the current UCS. If pt is provided, the user is prompted for the second point. you can also provide value by keyboard too.
msg (Optional)
A string to be displayed to prompt the user. If no string is supplied, AutoCAD does not display a message.
Return Values
A real number. If a 3D point is provided, the returned value is a 3D distance.
you can use getdist by three ways.
-->> 1. you can use getdist by entering value from keyboard. type this at command line.
(setq dist1 (getdist "Pick First point or enter Distance :"))
The below prompt will appear
Pick First point or enter Distance :
Now type 150 from keyboard. once you entered, 150 is assigned to variable dist1. check value of variable dist1 by entering following
!dist1
the distance value 150 displyed.
-->> 2. you can use getdist by pick point from screen. type this at command line.
(setq dist1 (getdist "Pick First point or enter Distance :"))
The below prompt will appear
Pick First point or enter Distance :
now pick a point on graphic screen. you will get following prompt immediatly
Specify second point:
And a rubber band line from the first point to the current crosshairs position will appear. it helps the user visualize the distance.
now pick second point on graphic screen. the distance between first and second point is assigned to variable dist1. to check the value of variable dist1 enter following at command line
!dist1
And you get the distance between two point we picked earlier.
-->> 3. you can use getpoint for first point or use your previous point variable. to do this enter following
(setq pt1 (getpoint "Pick a Point :"))
when pick a Point prompt appear pick point anywhere on the screen. the coordinate is assigned to variable pt1. now we use this pt1 variable as our primary argument in getdist function. type this at command line
(setq dist1 (getpoint pt1 "Specify second point :"))
Specify second point:
above prompt will appear And a rubber band line from the first point to the current crosshairs position will appear. now pick a point on graphic screen. the distance between first and second point is assigned to variable dist1.
Getangle or Getorient - Pauses for user input of an angle
The difference between Getangle and Getorient is that Getangle will return an angle value relative to the current Unit setting for the 0 angle while Getorient will return an angle with default zero-radian direction to the right (east). For example, the default zero-radian direction is set to east side but you can use the Units command or the Angbase system variables to make 0 degrees a vertical direction. If a drawing is set up with 0 degrees being a direction from bottom to top, Getangle will return a value relative to this orientation while Getorient will return a value based on the "Defalt" orientation regardless of the Units, Angbase settings. below Figure showing the default zero-radian direction of base angle (units command).
Autocad's Unit command Dialogue Box
Comparision of Getangle & Getorient
Now if we set base angle to north by Units command or angbase system variable as shown in image above. the getangle is return angle 5.757 and for the same getorient will return 1.0446. both function uses anticlock wise direction. now we look about this two functions syntax and its use.
The syntax for getangle is
and the syntax for getorient is
(getorient [pt] [msg] )
pt (Optional)
A 2D base point in the current UCS. If pt is provided, the user is prompted for the second point. you can also provide value by keyboard too.
msg (Optional)
A string to be displayed to prompt the user. If no string is supplied, AutoCAD does not display a message.
Return Values
The angle specified by the user, in radians.
you can use getangle or getorient by both keyboard enty and by pick a point on screen. first type below on command line
(setq ang1 (getangle "Pick First point or enter Distance :"))
you will see the prompt Pick First point or enter Distance : at command line now type 60 by keyboard and check value of variable ang1.
you get 1.0472 as answer. why? you type 60 degree on screen. because getangle returns the output value in radians.
as we do with getdist previously, you can supply a point variable as an argument to getangle
enter this
(setq pt1 (list 2 5))
now enter this expression on command line
(setq ang1 (getangle pt1 "Pick Second point :"))
A rubber-banding line appears from the coordinate 3,3. now Pick a point other than coordinate 2,5. The angle from pt1 to second point is assigned to ang1.
To get the value of ang1, enter:
the value of ang1 is returned.