Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

2D or 3D drawing

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
Anonymous
591 Views, 4 Replies

2D or 3D drawing

Hello I'm trying to write a code see if the drawing is 2D or 3D. I am not a programmer, but in the process of learning as i go.

 

here is a sample of my code.

 

(defun c:IS2D ()

   (setq dr (getvar "dwgname"))
   (setq a (getvar "EXTMAX"))
   (setq pt1 (caddr a))
          (if (= pt1 0.0)
          (command "-_saveas" "dwg" "2010" (strcat "H:\\"dr_2D))
          (command "-_saveas" "dwg" "2010" (strcat "H:\\"dr_3D))
)

(princ)
)

 

Any help would be appreciated.

4 REPLIES 4
Message 2 of 5
Jonathan3891
in reply to: Anonymous

You only had a few things incorrect.

 

 

(defun c:test ()
   (setq dr (getvar "dwgname"))
   (setq a (getvar "EXTMAX"))
   (setq pt1 (caddr a))
          (if (= pt1 0)
          (command "_saveas" "2010" (strcat "C:\\" "dr_2D"))
          (command "_saveas" "2010" (strcat "C:\\" "dr_3D"))
)

(princ)
)
 

Jonathan Norton
Blog | Linkedin
Message 3 of 5

(strcat "C:\\" DR "_2D"))

To append the filename use the above format

 

Message 4 of 5
Anonymous
in reply to: Jonathan3891

Thanks DSM_dude!

 

Its working!!! this is going to save me some good time! Man Very Happy

Message 5 of 5
Jonathan3891
in reply to: Anonymous

Your welcome!

Don't forget to accept my post as the solution!


Jonathan Norton
Blog | Linkedin

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

Post to forums  

Autodesk Design & Make Report

”Boost