marko_ribar Posted November 20, 2013 Posted November 20, 2013 (edited) Shay, like you had hunch for mistake... Code was updated once more... That line is just for converting old heavy polyline from sel. set of heavy polylines to LWPOLYLINE, that are in the end of code converted back like there were no modifications... Edited November 21, 2013 by marko_ribar Quote
samifox Posted November 22, 2013 Author Posted November 22, 2013 What entity name the old poly line has? Quote
MSasu Posted November 22, 2013 Posted November 22, 2013 The entity name (that it, stored under DXF code -1) of old type (also known as heavy) polyline is POLYLINE. Quote
samifox Posted November 22, 2013 Author Posted November 22, 2013 The entity name (that it, stored under DXF code -1) of old type (also known as heavy) polyline is POLYLINE. Marko code never acquire entity by -1 , he always acquire it by wildcard search *POLYLINE. so i hardly get sense of it Quote
marko_ribar Posted November 22, 2013 Posted November 22, 2013 Look Shay, this line : (setq ss (ssget "_I" '((0 . "*POLYLINE") (-4 . "<and") [color=red](-4 . "<not") (-4 . "&=") (70 . (-4 . "not>")[/color] [color=blue](-4 . "<") (70 . 130)[/color] (-4 . "and>")))) filters all entities both LWPOLYLINE and POLYLINE (that's why "*POLYLINE") - marked red are those entities that are not 3d polylines, and marked blue are only polylines that don't have smoothness (fit/quadratic/cubic) - this is referenced to old heavy 2d polylines (POLYLINE entities - not LWPOLYLINE entities)... If you look closer to DXF 70 codes for (fit/quadratic/cubic) POLYLINE entities (2d - 3d we already filtered out), you'll see that their values are greater than 129 - this is why (-4 . " So when selection is made - sel.set will contain only entities on witch code can perform operations - so then we differ only LWPOLYLINE in one side and POLYLINE on the other side... If LWPOLYLINE entity is to be processed (plintav) sub-function can operate correctly, but if POLYLINE entity (that is 2d old heavy polyline) is to be processed they have to be converted to LWPOLYLINE entity, then (plintav) will process them, and then in the end they are converted back to POLYLINE entities... (command "_.convertpoly" "h" [or] "l" ent "") - "h" stands for conversion of LWPOLYLINE to old heavy 2d POLYLINE, and "l" stands for opposite conversion... HTH Quote
MSasu Posted November 22, 2013 Posted November 22, 2013 wildcard search *POLYLINE For the wildcard options you may check the help of WCMATCH function. Quote
samifox Posted November 27, 2013 Author Posted November 27, 2013 Look Shay, this line : (setq ss (ssget "_I" '((0 . "*POLYLINE") (-4 . "<and") [color=red](-4 . "<not") (-4 . "&=") (70 . (-4 . "not>")[/color] [color=blue](-4 . "<") (70 . 130)[/color] (-4 . "and>")))) filters all entities both LWPOLYLINE and POLYLINE (that's why "*POLYLINE") - marked red are those entities that are not 3d polylines, and marked blue are only polylines that don't have smoothness (fit/quadratic/cubic) - this is referenced to old heavy 2d polylines (POLYLINE entities - not LWPOLYLINE entities)... If you look closer to DXF 70 codes for (fit/quadratic/cubic) POLYLINE entities (2d - 3d we already filtered out), you'll see that their values are greater than 129 - this is why (-4 . " So when selection is made - sel.set will contain only entities on witch code can perform operations - so then we differ only LWPOLYLINE in one side and POLYLINE on the other side... If LWPOLYLINE entity is to be processed (plintav) sub-function can operate correctly, but if POLYLINE entity (that is 2d old heavy polyline) is to be processed they have to be converted to LWPOLYLINE entity, then (plintav) will process them, and then in the end they are converted back to POLYLINE entities... (command "_.convertpoly" "h" [or] "l" ent "") - "h" stands for conversion of LWPOLYLINE to old heavy 2d POLYLINE, and "l" stands for opposite conversion... HTH Hi thanks for your explanation , first of all i still analyzing your code, and learn a lot by it in general your goal was to turn all entities to LWPOLYLINE , and then to VLA-OBJECT, why not directly to VLA-OBJECT? than you send each pair of entities to intersection test, and construct a list of intersection points by analyzing this part of the code , i have some questions : 1. Variable l , it seems it was misplaced there, correct? 2. why the index p is advanced and then going backward? 3. LM:Unique definition and flow is is really confusing me, could you explain please? (defun LM:Unique ( lst ) (if lst (cons (car lst) (LM:Unique (vl-remove (car lst) (cdr lst))))) ) (defun AT:GetVertices ( e / p l ) (LM:Unique (if e (if (eq (setq p (vlax-curve-getEndParam e)) (fix p));_make sure that the vertex is really sitting on the end (repeat (setq p (1+ (fix p))) (setq l (cons (vlax-curve-getPointAtParam e (setq p (1- p))) l)); ) (list (vlax-curve-getStartPoint e) ; (vlax-curve-getEndPoint e));_ ) ) ) ) Quote
Lee Mac Posted November 27, 2013 Posted November 27, 2013 3. LM:Unique definition and flow is is really confusing me, could you explain please? (defun LM:Unique ( lst ) (if lst (cons (car lst) (LM:Unique (vl-remove (car lst) (cdr lst))))) ) LM:Unique is taken from here Quote
GP_ Posted November 27, 2013 Posted November 27, 2013 Look Shay, this line : (setq ss (ssget "_I" '((0 . "*POLYLINE") (-4 . "<and") [color=red](-4 . "<not") (-4 . "&=") (70 . (-4 . "not>")[/color] [color=blue](-4 . "<") (70 . 130)[/color] (-4 . "and>")))) filters all entities both LWPOLYLINE and POLYLINE (that's why "*POLYLINE") - marked red are those entities that are not 3d polylines, and marked blue are only polylines that don't have smoothness (fit/quadratic/cubic) Marko, not work, maybe like this: (setq ss (ssget '( (0 . "*POLYLINE") (-4 . "<and") (-4 . "<not") (-4 . "&=") (70 . (-4 . "not>") (-4 . "<not") (-4 . "&=") (70 . 2) (-4 . "not>") (-4 . "<not") (-4 . ">") (75 . 0) (-4 . "not>") (-4 . "and>") ) ) ) Quote
samifox Posted November 27, 2013 Author Posted November 27, 2013 Marko, not work, maybe like this: (setq ss (ssget '( (0 . "*POLYLINE") (-4 . "<and") (-4 . "<not") (-4 . "&=") (70 . (-4 . "not>") (-4 . "<not") (-4 . "&=") (70 . 2) (-4 . "not>") (-4 . "<not") (-4 . ">") (75 . 0) (-4 . "not>") (-4 . "and>") ) ) ) i think marko just wanted to explain , not to compile 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.