Hi,
I want to create a script to select some particular object from a drawing.
anyone help me to select object through command line (without dialogue box)?
Thanks,
Sandeep kumar
|
Hi,
I want to create a script to select some particular object from a drawing.
anyone help me to select object through command line (without dialogue box)?
Thanks,
Sandeep kumar
The filter command has always used a dialog box. I've got the old lsp and dcl files, if you'd like me to send them offline. You could probably modify it to work without the dialog box. Have you tried ssx.lsp and getsel.lsp which come with AutoCAD? Lots of ways to select objects with lisp. What specifically are you trying to do?
Thanks for your reply,
Yesterday we got some (300) structural details, change the colour of two leyers named border & notes to cyan (colour index4) at each drawing. and some drawing have two dimension layers, one with correct spelling (dmensions) and the other with misspelled (dimesions) I want to select all dimension object to the proper dimensions layer. and delete the other one.
I create a script to do that and run with scriptpro , but where the detail have one layer of dimensions, the script will stuck there. bcz there is no dimesions layer to rename.
Any idea???
To make sure that there's no problem with layers not existing in a drawing, you could use some LISP inside the SCR:Basically it checks if the wrongly spelt dimesions layer exists (if not it doesn't do anything). But if it does, it check if the correctly spelt layer dimensions exists. If that does, then it uses Layer Merge to "move" all entities from the wrong layer to the correct one & purge the wrong layer out. If the correct layer doesn't exist, then it simply renames the wrong one.Code:(if (tblsearch "LAYER" "dimesions") (if (tblsearch "LAYER" "dimensions") (command "._LAYMRG" "dimesions" "" "dimensions" "_Yes") (command ".-RENAME" "_LAyer" "dimesions" "dimensions") ) )
You can do similar stuff for other things as well. E.g. to change the colour of a layer only if it exists:Code:(if (tblsearch "LAYER" "border") (command ".-LAYER" "_Color" 4 "border" "") )
Attached modified script and DWG.
I did have an error with the LAYMRG command. Fixed it in attached SCR.
Oooohhhh! Sorry LAYMRG used to be an Express Tool prior to 2007. Do you have Express installed? If so check for the command when you use Express --> Layers --> Merge Layers. Then also check what prompts is asked, maybe they differ from the new built-in command.
Last edited by sandeepk; 2009-05-08 at 06:28 AM.
Try doing the LAYMRG command in Model Space (i.e. TILEMODE=1). Maybe there was a change in this command since 2004. Unfortunately I'm on subscription, so I can't install my old version to check