Jump to content

script to select all lines - Autocad LT


dan_g8

Recommended Posts

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

Link to comment
Share on other sites

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;;

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 3 weeks later...
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.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...