irneb Posted January 17, 2011 Share Posted January 17, 2011 What is T?Because Lisp is (mostly) a functional language ... everything in Lisp returns something. That's the main reason you add (princ) at the end of a defun command, otherwise you get a message on the command line stating the last value calculated inside the defun. The T is an internal Lisp value which means "true". The T you see is actually coming from the layerstate-restore function (since it's the last thing which did anything). If either layerstate-import / layerstate-restore failed, you would see "nil" at the command line (which is analogous to "false"). The if tests if the layerstate-import is not nil (i.e. hasn't failed), only then does it call layerstate-restore. So you can even test if the state was restored, and only then call save (although then you need to call save through the command function). I'm glad you got it working at last. Did you get ScriptPro / AutoScript to work on your 64bit? Quote Link to comment Share on other sites More sharing options...
jtk07 Posted January 17, 2011 Author Share Posted January 17, 2011 After many painful conversations with Cadig via email, they did relase a 3.0 version that worked. Even tho there site said it worked the software was not posted as it said it was. later that day the website changed allowing download of the new software 3.0 not 2.5. Thanks again for all the help! I have a new post today. take a Look at it if you have time. Quote Link to comment Share on other sites More sharing options...
jeinbinder Posted February 26, 2014 Share Posted February 26, 2014 I am trying to just use a regular lisp to import a .las file i have saved in a certain spot. This is what i have so far: (defun c:eleclay () (layerstate-import "L:\Engineered_Solutions_CAD_Standards\Electrical\Layers\ElecLayers.LAS") ) I'm not sure where to go from here and its not working so far I want to be able to type the command for the lisp and then have it automatically load at set current all of the layers in the .las file Thanks in advance Quote Link to comment Share on other sites More sharing options...
alanjt Posted February 26, 2014 Share Posted February 26, 2014 I am trying to just use a regular lisp to import a .las file i have saved in a certain spot. This is what i have so far: (defun c:eleclay () (layerstate-import "L:\Engineered_Solutions_CAD_Standards\Electrical\Layers\ElecLayers.LAS") ) I'm not sure where to go from here and its not working so far I want to be able to type the command for the lisp and then have it automatically load at set current all of the layers in the .las file Thanks in advance As long as your file path is valid, what you have should work. I would suggest adding a (princ) before the closing paren. Now, when you say 'set current all of the layers in the .las file', what do you mean? You can only have one current layer at a time. Quote Link to comment Share on other sites More sharing options...
jeinbinder Posted February 26, 2014 Share Posted February 26, 2014 I basically just want to import this .las file and have the layers show up in my drawing. This is my first lisp ever so i'm most likely doing something wrong. I went into AutoCAD's lisp routine writer then put what i posted above in. Then i saved the lisp, loaded it, and tried it and nothing happened. I'll try it with an easier file path and with the (princ) Quote Link to comment Share on other sites More sharing options...
jeinbinder Posted February 26, 2014 Share Posted February 26, 2014 Here is what i have now (defun c:eleclay () (layerstate-import "C:Lisp\\ElecLayers.las") (princ) ) Quote Link to comment Share on other sites More sharing options...
Snownut Posted February 26, 2014 Share Posted February 26, 2014 Change (layerstate-import "C:Lisp\\ElecLayers.las") to (layerstate-import "C:\\Lisp\\ElecLayers.las") Quote Link to comment Share on other sites More sharing options...
jeinbinder Posted February 26, 2014 Share Posted February 26, 2014 Perfect thank you very very much Quote Link to comment Share on other sites More sharing options...
alanjt Posted February 26, 2014 Share Posted February 26, 2014 Change (layerstate-import "C:Lisp\\ElecLayers.las") to (layerstate-import "C:\\Lisp\\ElecLayers.las") Good catch. Quote Link to comment Share on other sites More sharing options...
Bhull1985 Posted February 27, 2014 Share Posted February 27, 2014 jeanbinder, don't forget to study up on lee mac's website if you're just learning- many valuable lessons therein. Specifically, here are a few for beginners. Localising Variables in autolisp: http://www.lee-mac.com/quicklocalising.html Correct methods to prompt for user information: http://www.lee-mac.com/promptwithdefault.html And the multitude of other tutorials Lee has been so kind as to place on his website. Quote Link to comment Share on other sites More sharing options...
alanjt Posted February 27, 2014 Share Posted February 27, 2014 jeanbinder, don't forget to study up on lee mac's website if you're just learning- many valuable lessons therein.Specifically, here are a few for beginners. Localising Variables in autolisp: http://www.lee-mac.com/quicklocalising.html Correct methods to prompt for user information: http://www.lee-mac.com/promptwithdefault.html And the multitude of other tutorials Lee has been so kind as to place on his website. And the site we all owe a huge debt of gratitude to, afralisp. http://www.afralisp.net/index.php Quote Link to comment Share on other sites More sharing options...
Bhull1985 Posted February 27, 2014 Share Posted February 27, 2014 Yes, definitely. I just had assumed everyone and their mother has visited afralisp more than a handful of times Quote Link to comment Share on other sites More sharing options...
Snownut Posted February 27, 2014 Share Posted February 27, 2014 Yes, definitely.I just had assumed everyone and their mother has visited afralisp more than a handful of times Not sure my mothers been there but I've been there several dozen times.... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.