martinle Posted July 16, 2013 Share Posted July 16, 2013 Hello Does anyone have an idea how to solve the following problem with Lisp? I have the following layers: wall wall dimension closet cabinet Dimensions If I draw a cabinet or a wall and then want to set the dimension I must always select the corresponding dimension layers and then call the dimensioning command. How could the solvent faster with Lisp? For example, according to the sign of the wall by clicking the wall layer automatically switch to the corresponding dimension layers and at the same time invoke the Dimension command. Please help me to solve this problem. Thank you Greetings Martin:) Quote Link to comment Share on other sites More sharing options...
Dadgad Posted July 16, 2013 Share Posted July 16, 2013 Lee Mac wrote a wonderful lisp called LAYER DIRECTOR , which is but one of a great many which he very generously makes available for free on his website. It won't do everything you are looking for, but it is a great step in that direction. Thanks Lee! Try it, you'll be very glad you did. This functionality should be built into the program, it is outstanding. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted July 16, 2013 Share Posted July 16, 2013 Just an example for the wall dimension layer and I am sure you can modify the code to work with the other layer name (defun c:wdim (/ *error* cl) (defun *error* (x) (if cl (setvar 'CLAYER cl) ) (princ "\n*Cancel*") ) (if (tblsearch "LAYER" "wall dimension") (progn (setq cl (getvar 'CLAYER)) (setvar 'CLAYER "wall dimension") (command "_.dimlinear") (setvar 'CLAYER cl) ) (princ "Layer < wall dimension > is not found !!") ) (princ) ) Quote Link to comment Share on other sites More sharing options...
martinle Posted July 16, 2013 Author Share Posted July 16, 2013 Hello Dadgad Thank you for your quick help. I know and appreciate very much Mr. Lee. He helps us with his programs much further. It's great for this forum and for us, that Mr. Lee over and over helps. Mr Lee said Lisp only switches to a layer for dimensioning command. For me there are however several dimension layers, one for wall, cabinet etc. for ..... lg. Martin Quote Link to comment Share on other sites More sharing options...
martinle Posted July 16, 2013 Author Share Posted July 16, 2013 Hi Tharwat Thank you very appriciated for your help. The Lisp works very well. However, I try the following: When I drew the finished wall should Lisp for the dimension of the wall see which layer was last used. If the layer is wall last used date should be set for the dimensioning command of Layer Wall dimensions. But if I have recently drawn a cabinet should be set at the current call from the Dimension command of Layer cabinet dimensions But there are several dimension layers Thank you for your help Greetings Martin Quote Link to comment Share on other sites More sharing options...
Tharwat Posted July 16, 2013 Share Posted July 16, 2013 Just copy the code that I posted above and change the name of the routine and the name of the layer , so after that you would have two routines , and this should be good enough . Quote Link to comment Share on other sites More sharing options...
martinle Posted July 16, 2013 Author Share Posted July 16, 2013 Hello Mr. Tharwat! I do not want to be outrageous and thank them for their help. Unfortunately, I have more than two layers for dimensions. Overall, there are 15 pieces. If this Lisp could see which layer is current and would then put the associated dimension layers currently in a list that would be very great. Mr. Tharwat please help me. Thank you very much! Greetings Martin Quote Link to comment Share on other sites More sharing options...
Tharwat Posted July 16, 2013 Share Posted July 16, 2013 Is it okay with you to have a dialog box with a list of dimensions layers that you have in your drawing then you should select the layer name with every time you run the code to lay the dimension object on ? Quote Link to comment Share on other sites More sharing options...
martinle Posted July 16, 2013 Author Share Posted July 16, 2013 Hello Mr. Tharwat! I do it at the time of the tool palettes. I have a button for each dimension layers with Command; layer; se; wall dimensions ....... I actually wanted just to make a button with a lisp that would poll just before the dimensioning command the current layer and then set the corresponding matching dimension layers. This would be a very good solution. Greetings Martin Quote Link to comment Share on other sites More sharing options...
Tharwat Posted July 16, 2013 Share Posted July 16, 2013 Okay , - How many dimension layers you have in your drawing ? - How could I code the lisp and at what time you need to use this layer name or the other layer name ? Quote Link to comment Share on other sites More sharing options...
martinle Posted July 16, 2013 Author Share Posted July 16, 2013 Hello Mr. Tharwat! I have 18 layers for dimensions. Ideal would be the following Lisp. Whenever I run a Dimension command "_dimlinear", "_dimaligned" ..... Lisp should check which layer was last used. In a list in the lisp then the matching layer should be assigned for the dimension. This should then be placed before the current dimensioning command. After the end of the dimensioning command should the layer on the old layers are reset again. Thank you! Greetings Martin 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.