Visual LISP, AutoLISP and General Customization

Reply
Distinguished Mentor
Moshe-A
Posts: 735
Registered: ‎09-14-2003
Message 11 of 20 (153 Views)

Re: export behaves odd in lisp

09-25-2012 12:16 PM in reply to: jmaeding

OK i see the problem but

just wonder if (ssget) solved it why not use it?

Distinguished Contributor
jmaeding
Posts: 927
Registered: ‎12-27-2006
Message 12 of 20 (148 Views)

Re: export behaves odd in lisp

09-25-2012 01:00 PM in reply to: Moshe-A

I would, I am just not sure what its really doing.

Your code exits with an error, though it seems to work.

I will try a couple things first, mainly (command "select" "") to see if I can get it down to one3 case at the export step.

thanks a bunch for your thoughts on this so far!

Distinguished Mentor
Moshe-A
Posts: 735
Registered: ‎09-14-2003
Message 13 of 20 (144 Views)

Re: export behaves odd in lisp

09-25-2012 01:08 PM in reply to: jmaeding

what is the error? send a picture

for me it runs clean

 

Distinguished Contributor
jmaeding
Posts: 927
Registered: ‎12-27-2006
Message 14 of 20 (135 Views)

Re: export behaves odd in lisp

09-25-2012 03:02 PM in reply to: Moshe-A

I get this:

 

Command: ttt
Insertion base Point: Unknown command "TTT".  Press F1 for help.

 

I am not sure why it gives that since TTT is defined. It should have failed on the SS param.

I'll probably just use that as the error seems benign.

Distinguished Mentor
Moshe-A
Posts: 735
Registered: ‎09-14-2003
Message 15 of 20 (125 Views)

Re: export behaves odd in lisp

09-25-2012 10:59 PM in reply to: jmaeding

this error means that you got an extra enter

 

 

 

 

 

Distinguished Contributor
jmaeding
Posts: 927
Registered: ‎12-27-2006
Message 16 of 20 (115 Views)

Re: export behaves odd in lisp

09-26-2012 07:35 AM in reply to: Moshe-A

I agree, and worry a bit about what that might do in certain situations.

It was your extra enter though :smileyhappy:

There is some bug going on, as simply adding "oops" after the command messes it up.

It works fine when you type it, just not in the flow of lisp.

Distinguished Mentor
Moshe-A
Posts: 735
Registered: ‎09-14-2003
Message 17 of 20 (109 Views)

Re: export behaves odd in lisp

09-26-2012 08:33 AM in reply to: jmaeding

 

OK,

 

i removed the extra enter, does it's works now?

 

moshe

 

 

(defun c:ttt (/ fname ss ins)

 (defun askPoint ()
  (setq ins (getpoint "\nInsertion base Point: "))
 )
   
 (setq fname "C:\\TEMP\\JAMES.dwg")
  
 (if (setq ss (ssget "i"))
  (if (askPoint)
   (command ".export" fname ins ss "" "oops")
  ); if
  (if (setq ss (ssget))
   (if (askPoint)
    (command ".export" fname "" ins ss "" "oops")
   ); if
  ); if
 ); if

 (princ)
)

 

Distinguished Contributor
jmaeding
Posts: 927
Registered: ‎12-27-2006
Message 18 of 20 (103 Views)

Re: export behaves odd in lisp

09-26-2012 09:36 AM in reply to: Moshe-A

yah, it does. I am sure I tried that before, here is revised test code:

(DEFUN C:TTT ( / SS PICKPT tempdrawing james)
	(SETQ SS (SSGET "I"))
	(SETQ PICKPT (getpoint "\nPick Insert Point"))
	(setq tempdrawing "C:\\TEMP\\tempp.DWG")
	(command ".export" tempdrawing PICKPT SS "" "OOPS")
)

 I will have to look back over what I did before, as I must have fooled myself that I tried it.

Maybe the fact that it behaves differently in lisp than on command line tricked me, but it seems its working now.

Thanks again.

Distinguished Mentor
Moshe-A
Posts: 735
Registered: ‎09-14-2003
Message 19 of 20 (99 Views)

Re: export behaves odd in lisp

09-26-2012 10:02 AM in reply to: jmaeding

Hallelujah!

 

Hallelujah!

 

Hallelujah!

 

:smileyvery-happy:

 

:smileylol:

 

:smileyhappy:

 

 

Distinguished Contributor
jmaeding
Posts: 927
Registered: ‎12-27-2006
Message 20 of 20 (93 Views)

Re: export behaves odd in lisp

09-26-2012 10:59 AM in reply to: Moshe-A

I posted the WTIT.lsp in a new thread, if you want to see the results of our labor.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community