CADkitt Posted April 29, 2010 Posted April 29, 2010 So I want to select all lines with hidden after a flatshot, and then change them to layer 7 which is the hidden lines layer. Now I figured the following code out myself true the forums and tutorials. (defun C:selh(/) (prompt "\nSelect Objects by Window") (setq p1 (getpoint "\nFirst Corner: ")) (setq p2 (getpoint p1 "\nSecond Corner: ")) (setq sel1 (ssget "w" p1 p2 '((0 . "HIDDEN")(8 . "0"))) (princ) ) But like always it doesn't work (or at least it looks like that.) And is there a quick way to test of the selection set is working? Quote
lpseifert Posted April 29, 2010 Posted April 29, 2010 And is there a quick way to test of the selection set is working? at the command line start the Select command at the Select objects: prompt enter !sel1 (the selected objects should be highlighted) if you're trying to select the "line" entities on layer "0" with a "hidden" linetype in a window (setq p1 (getpoint "\nFirst Corner: ")) (setq p2 (getcorner p1 "\nSecond Corner: ")) (setq sel1 (ssget "_W" p1 p2 '((0 . "LINE") (8 . "0") (6 . "HIDDEN")))) Quote
CADkitt Posted April 29, 2010 Author Posted April 29, 2010 Cool thanks for your reply, how did you know you had use the number 6? Which manual or book should I get? :S I btw get a bad ssget list argument back This one seems to work (defun C:selh(/) (setq p1 (getpoint "\nFirst Corner: ")) (setq p2 (getcorner p1 "\nSecond Corner: ")) (setq sel1 (ssget "_W" p1 p2 '((6 . "HIDDEN")(8 . "0")))) (princ) ) Quote
CADkitt Posted April 29, 2010 Author Posted April 29, 2010 (defun C:selh(/) (setq p1 (getpoint "\nFirst Corner: ")) (setq p2 (getcorner p1 "\nSecond Corner: ")) (setq SS1 (ssget "_W" p1 p2 '((6 . "HIDDEN")(8 . "0")))) (command "_.chprop" ss1 "" "la" "7" "") (setq SS2 (ssget "_W" p1 p2 )) (command "_.chprop" ss2 "" "la" "" "bylayer" "bylayer" "bylayer" "bylayer" "bylayer") (princ) ) But (command "_.chprop" ss2 "" "la" "" "bylayer" "bylayer" "bylayer" "bylayer" "bylayer") isn't correct I made it so everything but the line thickness get set right, but screwed it up while finding the line thickness. Quote
lpseifert Posted April 29, 2010 Posted April 29, 2010 Provide (command "_.chprop" with the 'arguments' as you would from the command line Quote
CADkitt Posted April 29, 2010 Author Posted April 29, 2010 Woot I did it and learned a lot of it (must have code if you use flat-shot and hidden lines layer!! (defun C:selh(/) (progn (setq p1 (getpoint "\nFirst Corner: ")) (setq p2 (getcorner p1 "\nSecond Corner: ")) (setq SS1 (ssget "_W" p1 p2 '((6 . "HIDDEN")(8 . "0")))) (command "_.chprop" ss1 "" "la" "7" "") (setq SS2 (ssget "_W" p1 p2 )) (command "_.chprop" ss2 "" "color" "ByLayer" "") (command "_.chprop" ss2 "" "lweight" "bylayer" "") (command "_.chprop" ss2 "" "ltype" "bylayer" "") ) (princ) ) Thanks for your help LP! Edit: For everyone that want to use it: The 7 in (command "_.chprop" ss1 "" "la" "7" "") is the hidden layer and the 0 in (setq SS1 (ssget "_W" p1 p2 '((6 . "HIDDEN")(8 . "0")))) is the layer of the view. Quote
lpseifert Posted April 29, 2010 Posted April 29, 2010 how did you know you had use the number 6? Which manual or book should I get? Developer Documentation >acad_dev.chm Also, sources of DXF codes http://images.autodesk.com/adsk/files/acad_dxf1.pdf http://autodesk.com/techpubs/autocad/acad2000/dxf/ Quote
CADkitt Posted April 29, 2010 Author Posted April 29, 2010 Developer Documentation >acad_dev.chm Also, sources of DXF codes ah tnx never thought about looking for dxf reference :S The code could btw work without the layer 0 filter just make a flatshot on any layer and the hidden lines to hidden. Code would be: (defun C:selh(/) (progn (setq p1 (getpoint "\nFirst Corner: ")) (setq p2 (getcorner p1 "\nSecond Corner: ")) (setq SS1 (ssget "_W" p1 p2 '((6 . "HIDDEN")))) (command "_.chprop" ss1 "" "la" "7" "") (setq SS2 (ssget "_W" p1 p2 )) (command "_.chprop" ss2 "" "color" "ByLayer" "") (command "_.chprop" ss2 "" "lweight" "bylayer" "") (command "_.chprop" ss2 "" "ltype" "bylayer" "") ) (princ) ) Quote
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.