dan_g8 Posted September 13, 2016 Share Posted September 13, 2016 Hi, im in the process of converting some tools from lsp into diesel/macros so that they cab be used in autocad lt. all is going well apart from acouple of the tools that use the boundary command or pickpoints for hatches. the problem is that splines or xrefs kill cad when i run the command. in my lsp program i simply made a selection set of all *lines and then when the boundary tool was run i used the last selected objects. how can i select all *lines in an autocad lt drawing via a macro or script? thanks Dan Quote Link to comment Share on other sites More sharing options...
steven-g Posted September 13, 2016 Share Posted September 13, 2016 Without seeing an example, the first thing that springs to mind would be, in the script draw a line, and then run the selectsimilar command using the option last, when it asks for an object. ^C^C^Cline;0,0;1,1;;selectsimilar;last;; Quote Link to comment Share on other sites More sharing options...
dan_g8 Posted September 14, 2016 Author Share Posted September 14, 2016 thanks steve, i totally overlooked selectsimilar! Quote Link to comment Share on other sites More sharing options...
YZ Posted September 15, 2016 Share Posted September 15, 2016 Selection is one of the biggest weaknesses in macros. I often make selection sets by locking all layers except the one(s) you want, _ai_selall, then move command, but move it to the same place. Then you can use "selet;previous;;". But that is tricky because your layers quite likely have other objects other than lines on them. The other option (not as automated as lisp) is to build a "filter" dialog box somewhere in your macro and use a saved filter set to quickly grab all the lines by user input... Quote Link to comment Share on other sites More sharing options...
steven-g Posted September 15, 2016 Share Posted September 15, 2016 Selection is one of the biggest weaknesses in macros. I agree with that wholeheartedly, if only quickselect was available with command line options. I often make selection sets by locking all layers except the one(s) you want, _ai_selall, then move command, but move it to the same place. Then you can use "selet;previous;;". But that is tricky because your layers quite likely have other objects other than lines on them. I have drawings with hundreds of layers just to make selection easier, used with selectsimilar it does give you the chance to do a lot of automation. The other option (not as automated as lisp) is to build a "filter" dialog box somewhere in your macro and use a saved filter set to quickly grab all the lines by user input... Have you found a way to use filter in a standard macro (LT version), filters are great for some things but I haven't found any way to use filter in a macro? Quote Link to comment Share on other sites More sharing options...
BIGAL Posted September 16, 2016 Share Posted September 16, 2016 Had a play last night and Filter appears to be one of those commands that can not be called without a dialouge popping up. Hopefully some one else may know. In full autocad you would use the ssget method. Quote Link to comment Share on other sites More sharing options...
YZ Posted October 6, 2016 Share Posted October 6, 2016 Have you found a way to use filter in a standard macro (LT version), filters are great for some things but I haven't found any way to use filter in a macro? No, I can call the filter dialog box, and then carry on with the macro once that has been activated. But no way to programmatically control the filter command. Adding filter and select to macros would extend the functionality ENORMOUSLY! I'd love it so much. But I suspect it is deliberate on Autodesk's part. 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.