AutoCAD Electrical
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
OSNAP/OSMO DE LISP ROUTINE
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hello All
I am having an issue with a lisp routine that sets a drawing to a set of defaults. I.E. zooms to extents,ortho on grid off ETC
I have the routine work all but the osnaps/osmode.
I can add the osnaps i want by listing them but i cannot add the apparent intersection osnap. the routine doesnt like the space. i tried an underscore, i tried no space, i tried just "apparent" with no success.
I went another route on setting the osmode to the number i wanted "31671" but the osnaps are not turned on after that.
i have also tried to turn on the osnaps with (command "._osnap" "on") after the osmode command no luck there either.
It doesnt matter which was I do it as long as it comes out with the desired osnaps on and theey are enabled.
below is the code i am using
thanks for any help
;Resets Default Drawing Settings
(prompt "\nType DDS-12 to run.....")
(DEFUN C: DDS-12 ()
;;Function sets default linetype, lineweight and color to bylayer
(command "._-LINETYPE" "S" "BYL" "")
(command "._-LWEIGHT" "BYL")
(command "._-COLOR" "BYL")
;;Function sets listed items to desired default settings
(command "._LWDISPLAY" "OFF")
(command "._ortho" "ON")
(command "._GRID" "OFF")
(command "._ZOOM" "E")
(command "._osmode" "31671")
or
(command "._OSNAP" "MIDPOINT,NEAREST,ENDPOINT,QUADRANT,INTERSECTION" "")
(command ".-LAYER" "m" "DefPoints" "c" "250" "" "s" "0" "")
(command "SNAPUNIT" "0.0625,0.0625")
(setvar "sdi" 1)
(setvar "filedia" 1)
);defun
(princ)
Solved! Go to Solution.
Re: OSNAP/OSMO DE LISP ROUTINE
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
You had a typo in the defun statement (I removed the space between "C:" and "DDs-12" and the two double quotes at the end of the Osnap was attempting to start the app again.
As is, it worked for me (ACE 2013).
I did not check every setting, just the Osnaps.
;Resets Default Drawing Settings (prompt "\nType DDS-12 to run.....") (DEFUN C:DDS-12 () ;;Function sets default linetype, lineweight and color to bylayer (command "._-LINETYPE" "S" "BYL" "") (command "._-LWEIGHT" "BYL") (command "._-COLOR" "BYL") ;;Function sets listed items to desired default settings (command "._LWDISPLAY" "OFF") (command "._ortho" "ON") (command "._GRID" "OFF") (command "._ZOOM" "E") (command "._OSNAP" "MIDPOINT,NEAREST,ENDPOINT,QUADRANT,INTERSECTION") (command ".-LAYER" "m" "DefPoints" "c" "250" "" "s" "0" "") (command "SNAPUNIT" "0.0625,0.0625") (setvar "sdi" 1) (setvar "filedia" 1) );defun
Ace User since 1998
Re: OSNAP/OSMO DE LISP ROUTINE
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
THANKS FOR YOUR INPUT
YEAH I KNEW ABOUT THE SPACE BETWEEN THE C; AND DDS BUT I DIDNT WANT IT TO SHOW A SMILIE FACE THERE GOOD CATCH!!!
BUT MY PROBLEM STILL EXISTS IN THAT I CANNOT ADD THE APPARENT INTERSECTION COMMAND TO THE OSNAP.
ANY IDEA OF WHAT IT NEEDS TO BE CALLED TO ADD IT TO THE ROUTINE THAT WAS MODIFIED?
THANKS AGAIN FOR YOUR HELP
Re: OSNAP/OSMO DE LISP ROUTINE
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
That is what I get for not thoroughly reading the post.
To get the Apparent Intersection just add "APP" (this is the 3 letter shortcut for Apparent Intersection.)
Ace User since 1998
Re: OSNAP/OSMO DE LISP ROUTINE
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
THANKS
I TRY TO PUT WHAT I HAVE TRIED TO DO SO IT TENDS TO BE A LONG POST
JUST TRYING NOT TO HAVE REPLIES TO SOMETHING I HAVE ALREADY TRIED
JUST TRYING TO BE THROUGH!!
IT WORKED GREAT
THANKS AGAIN FOR YOUR HELP
