ILoveMadoka Posted February 10, 2009 Posted February 10, 2009 Here are entity lists of 2 lines side by side. One is Continuous on is Hidden. You cannot tell which is which by what lisp returns. If it returned the Assoc 6 value I'd be fine but it does not. * List in AutoLISP format *((-1 . ) (0 . LINE) (330 . ) (5 . 571) (100 . AcDbEntity) (67 . 0) (410 . Model) (8 . 0) (100 . AcDbLine) (10 -60.0959 78.554 0.0) (11 -78.7209 78.554 0.0) (210 0.0 0.0 1.0)) Variable name is ENT * List in AutoLISP format *((-1 . ) (0 . LINE) (330 . ) (5 . 573) (100 . AcDbEntity) (67 . 0) (410 . Model) (8 . DEFAULT_2) (100 . AcDbLine) (10 -60.0959 78.679 0.0) (11 -78.7209 78.679 0.0) (210 0.0 0.0 1.0)) Variable name is ENT I need to know the code that will return the linetype assigned to a layer by selecting an entity. (The color too...) Is this really simple? I just don't know how to do it. Help please!! TIA!! Quote
uddfl Posted February 10, 2009 Posted February 10, 2009 the entity list does not return the linetype if it is bylayer. To obtain the linetype assigned to the layer, access the entity list of the actual layer of each line via (setq layer_name (cdr (assoc 8 (entget (ent))))) then (setq layer_ltype (cdr (assoc 6 (tblsearch "LAYER" layer_name)))) Quote
Lee Mac Posted February 10, 2009 Posted February 10, 2009 Also: (defun getLT (lay) (vlax-for layer (vla-get-layers (vla-get-activedocument (vlax-get-acad-object))) (if (eq (vla-get-name layer) lay) (setq lt (vla-get-Linetype layer)))) (princ (vl-princ-to-string lt))) Quote
ILoveMadoka Posted February 11, 2009 Author Posted February 11, 2009 How do I perform a get list of all the hidden lines in a drawing if they are bylayer? Something along these lines... (setq SS1 (ssget "X" (list (cons 6 "Hidden")))) Thanks so much for all your help and expertise!! Quote
Lee Mac Posted February 11, 2009 Posted February 11, 2009 Perhaps: (defun getLT (lt) (setq lLst "") (vlax-for layer (vla-get-layers (vla-get-activedocument (vlax-get-acad-object))) (if (eq (strcase (vla-get-Linetype layer)) (strcase lt)) (setq lLst (strcat (vla-get-name layer) (chr 44) lLst))))) (defun c:test (/ lLst) (vl-load-com) (getLT "Hidden") (setq lLst (vl-string-right-trim (chr 44) lLst)) (sssetfirst nil (ssget "X" (list (cons 8 lLst) (if (getvar "CTAB")(cons 410 (getvar "CTAB")) (cons 67 (- 1 (getvar "TILEMODE"))))))) (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.