Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Reply
Message 1 of 4
Anonymous
179 Views, 3 Replies

Osnap

Is there a way to have the user snap to a point or object and for the routine to execute different code for different osnaps? (i.e. if snaps to nearest point or object do this, or if snaps to insertion point do this)

Thanks
Court
3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: Anonymous

I think you could do something like that through the macros in CUI.

--
____________________
Bill DeShawn
Please reply to group only
Thank you
http://my.sterling.net/~bdeshawn

wrote in message news:5300986@discussion.autodesk.com...
Is there a way to have the user snap to a point or object and for the
routine to execute different code for different osnaps? (i.e. if snaps to
nearest point or object do this, or if snaps to insertion point do this)

Thanks
Court
Message 3 of 4
stevor
in reply to: Anonymous

Cade can be written to test each of your osnaps to a selected point value, sp, by your priority, as:
(cond
((setq ospn (osnap sp "NEA") (do-something.near-like.))
((setq ospn (osnap sp "END") (do-something.end-like.))
...
)
S
Message 4 of 4
scot-65
in reply to: Anonymous

Courtmyers,

Do you mean you want to do something like this:
(defun c:LE () (command "Line" "endp" pause)(princ))
(defun c:LI () (command "Line" "int" pause)(princ))
(defun c:LM () (command "Line" "mid" pause)(princ))
(defun c:LN () (command "Line" "nea" pause)(princ))
(defun c:LQ () (command "Line" "qua" pause)(princ))

Or like this:
(setq osm (getvar "osmode"))
(setvar "osmode" 512) (setq a (getpoint "[First point]: ")) ;nea
(setvar "osmode" 128) (setq b (getpoint a "Second point: ")) ;per
(setvar "osmode" osm)

Regardless of which one to use, you will need to pay close attention to your PGP file.

Good Luck!

Scot-65

Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.


Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Customer Advisory Groups


Autodesk Design & Make Report