Author Topic: FYI - New Initget settings in AutoCAD 2007  (Read 2611 times)

0 Members and 1 Guest are viewing this topic.

Sdoman

  • Guest
FYI - New Initget settings in AutoCAD 2007
« on: May 02, 2006, 09:43:28 AM »
 
How many times have you read this? :

Quote
Note Future versions of AutoLISP may use additional initget control bits, so avoid setting bits that are not listed here.

Well, they finally did add some new control bits in 2007.  Haven't tried them yet, but they look powerful:

Quote
256 ( bit 8 ) Give direct distance input precedence over arbitrary input. For external applications, arbitrary input is given precedence over direct distance input by default. Set this bit if you wish to force AutoCAD to evaluate user input as direct distance input. Note that legal point input from the keyboard always takes precedence over either direct distance or arbitrary input.

512 ( bit 9 ) If set before a call to getpoint or getcorner, a temporary UCS will be established when the cursor crosses over the edge of a planar face of a solid. The temporary UCS is reset when the cursor moves off of a face. It is dynamically re-established when the cursor moves over a different face. After the point is acquired, the dynamic UCS is reset to the current UCS. This functionality is not enabled for non-planar faces such as the side of a cylinder.

1024 ( bit 10 ) When calling getdist, getangle, getorient, getpoint, or getcorner, you may not want the distance, angle, orient, point, or corner to be influenced by ortho, polar, or otracking in the Z direction. Setting this bit before calls to any of these functions will temporarily disable ortho, polar, and otracking in the Z direction. This is useful when you create 2D entities such as PLINE, ARC, or CIRCLE, or when you use the ARRAY command, which creates only a 2D array. In 2D-only commands it can be confusing and error-prone to allow 3D points to be entered using ortho Z, polar Z, or otrack Z.



CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: FYI - New Initget settings in AutoCAD 2007
« Reply #1 on: May 02, 2006, 09:58:48 AM »
Thanks for the tip Steve. Looks interesting.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Sdoman

  • Guest
Re: FYI - New Initget settings in AutoCAD 2007
« Reply #2 on: May 02, 2006, 12:54:03 PM »
Thanks for the tip Steve. Looks interesting.

You're welcomed.  I tried drawing a 3d solid box and then setting Initget to 512, and immediately followed with a getpoint.  The faces of the box highlight as the cursor hover around them, but I don't understand the results:

Code: [Select]
(initget 512)
(getpoint "\nSpecify point on edge of solid: ")

Sometimes the result returns the correct point, other times it returns '(0.0 0.. 0.0) ?

whdjr

  • Guest
Re: FYI - New Initget settings in AutoCAD 2007
« Reply #3 on: May 02, 2006, 01:30:22 PM »
Is it picking up an osnap?

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: FYI - New Initget settings in AutoCAD 2007
« Reply #4 on: May 02, 2006, 01:42:53 PM »
What Will said.
Also try this:
Code: [Select]
(progn
(initget 512)
(getpoint "\nSpecify point on edge of solid: ")
)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Sdoman

  • Guest
Re: FYI - New Initget settings in AutoCAD 2007
« Reply #5 on: May 02, 2006, 03:18:58 PM »
Ok thanks Will and CAB.  When I use osnaps and pick and edge of a solid, the code returns the world coordinate point, same as if I ran the command "ID" and picked the point.  When I run the code and pick somewhere on the face of the solid, the UCS is temporarily moved to the pick point.  Thus the returned point is at the origin of the temporary UCS.  Not sure how this is useful, but it looks cool on the screen.

Using progn doesn't seem to alter the results.

I am now using the simple test below and playing around with the second initget call...

Code: [Select]

;; First draw a 3d box
(command ".box" "non" '(4 4 0) "non" '(10 10 0) 15)

(defun c:test ( / p1 p2)
  (initget 512)
  (setq p1 (getpoint "\nPick somewhere on a face of the box: "))
  ;;(initget)
  ;;(initget 512)
  (setq p2 (getcorner p1 "nOpposite corner: "))
  (list p1 p2)
 )