ReMark Posted September 6, 2011 Posted September 6, 2011 We'll all be looking forward to seeing how your new routine functions and what the end result looks like. Post a sample drawing file when you're done. Good luck. Quote
teknomatika Posted September 6, 2011 Author Posted September 6, 2011 ReMark, Certainly. For this, the pBe is helping me. Quote
teknomatika Posted September 6, 2011 Author Posted September 6, 2011 A schematic example of the process.yrw_example.dwg Quote
pBe Posted September 7, 2011 Posted September 7, 2011 The routine is best but there is still the same inconsistencies previously reported. My version of Autocad is 2009. The problem may result from it? What are the inconsistencies reported? im worried about overlapping entites as duplicates. will the overlapping part of entities counts as duplicates? Remark does have a point regarding layers alredy existing and using "Format > Layer Tools > Copy objects to new layers command" Quote
teknomatika Posted September 7, 2011 Author Posted September 7, 2011 pBe, Inconsistencies? The result after running the routine, trying several times in the same situation, it is not always the same. I do not understand why is happening. I think that you should try some situations. About duplicate entities, I think you'll understand if you open the file yrw_example.dwg file which already attached. In short: My concept of duplicate entities: In two identical overlapping drawings, are in the lower-order entities that have the same geometric characteristics of the existing higher order. They have the same geometry as the same coordinates, the same length, the same angle, etc.. Quote
ReMark Posted September 7, 2011 Posted September 7, 2011 It appears the task is not as simple and straightforward as one would have thought. What does/does not constitute a duplicate entity seems to be questionable thus far. Quote
teknomatika Posted September 7, 2011 Author Posted September 7, 2011 It appears the task is not as simple and straightforward as one would have thought. What does/does not constitute a duplicate entity seems to be questionable thus far. ReMark, I do not understand. In case, if we want, we forget the designation duplicate entities and we use the term common entities. Essentially, I want to the concept of the "overkill" tool in AutoCad, but instead of erasing entities, be able to record or isolate a layer itself. Quote
ReMark Posted September 7, 2011 Posted September 7, 2011 I'll gladly agree to use your terminology re: common entities but that won't change the fact that as of now the lisp routine you are counting on to make life easier is having some trouble discern what denotes a common entity. Perhaps it is the way the drawing is being constructed. Quote
David Bethel Posted September 7, 2011 Posted September 7, 2011 (edited) This should find lines that have are common endpoints ( regardless of direction), change the common lines to a layer "COMMON", color BYLAYER, then delete duplicate lines that reside on layer "COMMON": [b][color=BLACK]([/color][/b]defun c:findclin [b][color=FUCHSIA]([/color][/b]/ ss en ed p10 p11 dl cl[b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]princ [color=#2f4f4f]"\nPass #1...\n"[/color][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]and [b][color=NAVY]([/color][/b]setq ss [b][color=MAROON]([/color][/b]ssget [color=#2f4f4f]"X"[/color] [b][color=GREEN]([/color][/b]list [b][color=BLUE]([/color][/b]cons 0 [color=#2f4f4f]"LINE"[/color][b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b] [b][color=NAVY]([/color][/b]while [b][color=MAROON]([/color][/b]setq en [b][color=GREEN]([/color][/b]ssname ss 0[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]princ [color=#2f4f4f]"\r"[/color][b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]prin1 en[b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]setq ed [b][color=GREEN]([/color][/b]entget en[b][color=GREEN])[/color][/b] p10 [b][color=GREEN]([/color][/b]cdr [b][color=BLUE]([/color][/b]assoc 10 ed[b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b] p11 [b][color=GREEN]([/color][/b]cdr [b][color=BLUE]([/color][/b]assoc 11 ed[b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b] dl [b][color=GREEN]([/color][/b]cons [b][color=BLUE]([/color][/b]list p10 p11[b][color=BLUE])[/color][/b] dl[b][color=GREEN])[/color][/b] dl [b][color=GREEN]([/color][/b]cons [b][color=BLUE]([/color][/b]list p11 p10[b][color=BLUE])[/color][/b] dl[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]ssdel en ss[b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]princ [color=#2f4f4f]"\nPass #2...\n"[/color][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]and [b][color=NAVY]([/color][/b]setq ss [b][color=MAROON]([/color][/b]ssget [color=#2f4f4f]"X"[/color] [b][color=GREEN]([/color][/b]list [b][color=BLUE]([/color][/b]cons 0 [color=#2f4f4f]"LINE"[/color][b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b] [b][color=NAVY]([/color][/b]while [b][color=MAROON]([/color][/b]setq en [b][color=GREEN]([/color][/b]ssname ss 0[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]princ [color=#2f4f4f]"\r"[/color][b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]prin1 en[b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]setq ed [b][color=GREEN]([/color][/b]entget en[b][color=GREEN])[/color][/b] p10 [b][color=GREEN]([/color][/b]cdr [b][color=BLUE]([/color][/b]assoc 10 ed[b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b] p11 [b][color=GREEN]([/color][/b]cdr [b][color=BLUE]([/color][/b]assoc 11 ed[b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]if [b][color=GREEN]([/color][/b]or [b][color=BLUE]([/color][/b]member [b][color=RED]([/color][/b]list p10 p11[b][color=RED])[/color][/b] [b][color=RED]([/color][/b]cdr [b][color=PURPLE]([/color][/b]member [b][color=TEAL]([/color][/b]list p10 p11[b][color=TEAL])[/color][/b] dl[b][color=PURPLE])[/color][/b][b][color=RED])[/color][/b][b][color=BLUE])[/color][/b] [b][color=BLUE]([/color][/b]member [b][color=RED]([/color][/b]list p11 p10[b][color=RED])[/color][/b] [b][color=RED]([/color][/b]cdr [b][color=PURPLE]([/color][/b]member [b][color=TEAL]([/color][/b]list p11 p10[b][color=TEAL])[/color][/b] dl[b][color=PURPLE])[/color][/b][b][color=RED])[/color][/b][b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b] [b][color=GREEN]([/color][/b]entmod [b][color=BLUE]([/color][/b]subst '[b][color=RED]([/color][/b]8 . [color=#2f4f4f]"COMMON"[/color][b][color=RED])[/color][/b] [b][color=RED]([/color][/b]assoc 8 ed[b][color=RED])[/color][/b] ed[b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]ssdel en ss[b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]princ [color=#2f4f4f]"\nPass #3...\n"[/color][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]setq cl nil[b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]and [b][color=NAVY]([/color][/b]setq ss [b][color=MAROON]([/color][/b]ssget [color=#2f4f4f]"X"[/color] [b][color=GREEN]([/color][/b]list [b][color=BLUE]([/color][/b]cons 0 [color=#2f4f4f]"LINE"[/color][b][color=BLUE])[/color][/b][b][color=BLUE]([/color][/b]cons 8 [color=#2f4f4f]"COMMON"[/color][b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b] [b][color=NAVY]([/color][/b]while [b][color=MAROON]([/color][/b]setq en [b][color=GREEN]([/color][/b]ssname ss 0[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]princ [color=#2f4f4f]"\r"[/color][b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]prin1 en[b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]setq ed [b][color=GREEN]([/color][/b]entget en[b][color=GREEN])[/color][/b] p10 [b][color=GREEN]([/color][/b]cdr [b][color=BLUE]([/color][/b]assoc 10 ed[b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b] p11 [b][color=GREEN]([/color][/b]cdr [b][color=BLUE]([/color][/b]assoc 11 ed[b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]if [b][color=GREEN]([/color][/b]not [b][color=BLUE]([/color][/b]or [b][color=RED]([/color][/b]member [b][color=PURPLE]([/color][/b]list p10 p11[b][color=PURPLE])[/color][/b] cl[b][color=RED])[/color][/b] [b][color=RED]([/color][/b]member [b][color=PURPLE]([/color][/b]list p11 p10[b][color=PURPLE])[/color][/b] cl[b][color=RED])[/color][/b][b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b] [b][color=GREEN]([/color][/b]setq cl [b][color=BLUE]([/color][/b]cons [b][color=RED]([/color][/b]list p10 p11[b][color=RED])[/color][/b] cl[b][color=BLUE])[/color][/b] cl [b][color=BLUE]([/color][/b]cons [b][color=RED]([/color][/b]list p11 p10[b][color=RED])[/color][/b] cl[b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b] [b][color=GREEN]([/color][/b]entdel en[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]ssdel en ss[b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]if [b][color=NAVY]([/color][/b]setq ss [b][color=MAROON]([/color][/b]ssget [color=#2f4f4f]"X"[/color] '[b][color=GREEN]([/color][/b][b][color=BLUE]([/color][/b]8 . [color=#2f4f4f]"COMMON"[/color][b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b] [b][color=NAVY]([/color][/b]command [color=#2f4f4f]"_.CHPROP"[/color] ss [color=#2f4f4f]""[/color] [color=#2f4f4f]"_C"[/color] [color=#2f4f4f]"BYLAYER"[/color] [color=#2f4f4f]""[/color][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]redraw[b][color=FUCHSIA])[/color][/b][b][color=BLACK])[/color][/b] Quite a bit more than just overkill. And it will also be very slow on large drawings. -David Edited September 8, 2011 by David Bethel Fix Pass 3 Quote
teknomatika Posted September 8, 2011 Author Posted September 8, 2011 David, Thanks for the help. In this version, I thank that changes in the way it operates. I do not want to take action on global drawing but only the drawing that has been previously selected. Quote
teknomatika Posted September 8, 2011 Author Posted September 8, 2011 David, However I was testing. Like the previous version, sometimes some inconsistencies appear. For example: I attach a file, with a drawing composed of two lines with the same geometry, each belonging to different layers, one over the other, with exactly the same coordinates, but, however, the routine can not detect as these are common features. What is happening? see if the state: Command: findclin Pass #1... Pass #2... Pass #3... nil error_1.dwg Quote
pBe Posted September 8, 2011 Posted September 8, 2011 (edited) assoc 11 is not the same teknomatika. which means its ever so slightly different (floating point values). if you notice the overkill command includes numeric fuzz. we can incorporate that to the code but it will take some doing. in cases like that you can covnert the list to a string as a quick fix. (defun c:test (/ lvn objs entN ent OrgEnt ObjColl a Entcoll LstR dupobj ln nl pts) (vl-load-com) (setq objs (ssget ":L" '([color=blue](0 . "LINE")[/color](8 . "~*_D")))) (repeat (sslength objs) (setq entN (ssname objs 0)) (setq OrgEnt (cons entN OrgEnt)) (setq ent (entget entN)) (foreach itm '(-1 5 8 62 6) (setq ent (vl-remove (assoc (eval itm) ent) ent))) [color=blue](foreach[/color] [color=blue] itm ent[/color] [color=blue] (if (member (car itm)[/color] [color=blue] '(10 11))[/color] [color=blue] (progn[/color] [color=blue] (setq pts (cons (cdr itm)[/color] [color=blue] pts))[/color] [color=blue] (setq ent (vl-remove[/color] [color=blue] itm[/color] [color=blue] ent)))[/color] [color=blue] )[/color] [color=blue] )[/color] [color=blue] (setq ent (cons (list (cons 101 (rtos (apply 'distance pts) 2 2))) ent))[/color] (setq ObjColl (cons ent ObjColl) EntColl (cons (list ent entN) Entcoll) pts nil) (ssdel entN objs)) (while (setq a (car ObjColl)) (if ( member a (cdr ObjColl)) (progn (setq ObjColl (vl-remove a (cdr ObjColl))) (setq dupobj (entget (car (member (setq LstR (cadr (assoc a entcoll))) OrgEnt)))) (entmod (subst (cons 8 (setq NL (strcat (cdr (setq ln (assoc 8 dupobj))) "_D"))) (assoc 8 dupobj) dupobj)) (if (not (member NL lvn)) (progn (vla-put-color (vlax-ename->vla-object (tblobjname "LAYER" NL)) (cdr (assoc 62 (tblsearch "LAYER" (cdr ln))))) (setq lvn (cons NL lvn)))) ) (setq ObjColl (cdr ObjColl))) (prompt "\r\\") (princ LstR) (prompt "\t......Evaluating....please wait.. ") (princ) ) (princ) ) By the way there are also instances that direction in which the entities are created are different. especially for lines and plines Edited September 9, 2011 by pBe Update for direction and floating point value Quote
ReMark Posted September 8, 2011 Posted September 8, 2011 It seems you have run into a snag once again. Maybe it has to do with the way objects are being depicted in the drawing. Quote
pBe Posted September 8, 2011 Posted September 8, 2011 It seems you have run into a snag once again. Maybe it has to do with the way objects are being depicted in the drawing. You are quite right Remark, like you said It appears the task is not as simple and straightforward as one would have thought Good thing is the OP has limited the entities to Lines. so the routine can easily trick in comparing a string rather than a floating point. also a sub to remove assoc 10 and 11 first element what do you think? Quote
teknomatika Posted September 8, 2011 Author Posted September 8, 2011 I can already understand. pBe, With this change the routine is now more consistent. I will continue to work on more complex test to see if it works correctly. Quote
David Bethel Posted September 8, 2011 Posted September 8, 2011 David,Thanks for the help. In this version, I thank that changes in the way it operates. I do not want to take action on global drawing but only the drawing that has been previously selected. Sorry, It worked on my end. I thought the intent was to work on the global drawing ..... to find the common lines.... Quote
David Bethel Posted September 8, 2011 Posted September 8, 2011 Here is a version that rounds the point values to 8 places: [b][color=BLACK]([/color][/b]defun c:findclin [b][color=FUCHSIA]([/color][/b]/ ss en ed p10 p11 dl cl[b][color=FUCHSIA])[/color][/b] [color=#8b4513];;;ROUND A POINT VALUE[/color] [color=#8b4513];;;ARG -> Pointlist Decimalplace[/color] [color=#8b4513];;;RET -> POINT LIST[/color] [b][color=FUCHSIA]([/color][/b]defun roundpt [b][color=NAVY]([/color][/b]p d[b][color=NAVY])[/color][/b] [b][color=NAVY]([/color][/b]list [b][color=MAROON]([/color][/b]atof [b][color=GREEN]([/color][/b]rtos [b][color=BLUE]([/color][/b]car p[b][color=BLUE])[/color][/b] 2 d[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]atof [b][color=GREEN]([/color][/b]rtos [b][color=BLUE]([/color][/b]cadr p[b][color=BLUE])[/color][/b] 2 d[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]atof [b][color=GREEN]([/color][/b]rtos [b][color=BLUE]([/color][/b]caddr p[b][color=BLUE])[/color][/b] 2 d[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]princ [color=#2f4f4f]"\nPass #1...\n"[/color][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]and [b][color=NAVY]([/color][/b]setq ss [b][color=MAROON]([/color][/b]ssget [color=#2f4f4f]"X"[/color] [b][color=GREEN]([/color][/b]list [b][color=BLUE]([/color][/b]cons 0 [color=#2f4f4f]"LINE"[/color][b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b] [b][color=NAVY]([/color][/b]while [b][color=MAROON]([/color][/b]setq en [b][color=GREEN]([/color][/b]ssname ss 0[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]princ [color=#2f4f4f]"\r"[/color][b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]prin1 en[b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]setq ed [b][color=GREEN]([/color][/b]entget en[b][color=GREEN])[/color][/b] p10 [b][color=GREEN]([/color][/b]roundpt [b][color=BLUE]([/color][/b]cdr [b][color=RED]([/color][/b]assoc 10 ed[b][color=RED])[/color][/b][b][color=BLUE])[/color][/b] 8[b][color=GREEN])[/color][/b] p11 [b][color=GREEN]([/color][/b]roundpt [b][color=BLUE]([/color][/b]cdr [b][color=RED]([/color][/b]assoc 11 ed[b][color=RED])[/color][/b][b][color=BLUE])[/color][/b] 8[b][color=GREEN])[/color][/b] dl [b][color=GREEN]([/color][/b]cons [b][color=BLUE]([/color][/b]list p10 p11[b][color=BLUE])[/color][/b] dl[b][color=GREEN])[/color][/b] dl [b][color=GREEN]([/color][/b]cons [b][color=BLUE]([/color][/b]list p11 p10[b][color=BLUE])[/color][/b] dl[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]ssdel en ss[b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]princ [color=#2f4f4f]"\nPass #2...\n"[/color][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]and [b][color=NAVY]([/color][/b]setq ss [b][color=MAROON]([/color][/b]ssget [color=#2f4f4f]"X"[/color] [b][color=GREEN]([/color][/b]list [b][color=BLUE]([/color][/b]cons 0 [color=#2f4f4f]"LINE"[/color][b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b] [b][color=NAVY]([/color][/b]while [b][color=MAROON]([/color][/b]setq en [b][color=GREEN]([/color][/b]ssname ss 0[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]princ [color=#2f4f4f]"\r"[/color][b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]prin1 en[b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]setq ed [b][color=GREEN]([/color][/b]entget en[b][color=GREEN])[/color][/b] p10 [b][color=GREEN]([/color][/b]roundpt [b][color=BLUE]([/color][/b]cdr [b][color=RED]([/color][/b]assoc 10 ed[b][color=RED])[/color][/b][b][color=BLUE])[/color][/b] 8[b][color=GREEN])[/color][/b] p11 [b][color=GREEN]([/color][/b]roundpt [b][color=BLUE]([/color][/b]cdr [b][color=RED]([/color][/b]assoc 11 ed[b][color=RED])[/color][/b][b][color=BLUE])[/color][/b] 8[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]if [b][color=GREEN]([/color][/b]or [b][color=BLUE]([/color][/b]member [b][color=RED]([/color][/b]list p10 p11[b][color=RED])[/color][/b] [b][color=RED]([/color][/b]cdr [b][color=PURPLE]([/color][/b]member [b][color=TEAL]([/color][/b]list p10 p11[b][color=TEAL])[/color][/b] dl[b][color=PURPLE])[/color][/b][b][color=RED])[/color][/b][b][color=BLUE])[/color][/b] [b][color=BLUE]([/color][/b]member [b][color=RED]([/color][/b]list p11 p10[b][color=RED])[/color][/b] [b][color=RED]([/color][/b]cdr [b][color=PURPLE]([/color][/b]member [b][color=TEAL]([/color][/b]list p11 p10[b][color=TEAL])[/color][/b] dl[b][color=PURPLE])[/color][/b][b][color=RED])[/color][/b][b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b] [b][color=GREEN]([/color][/b]entmod [b][color=BLUE]([/color][/b]subst '[b][color=RED]([/color][/b]8 . [color=#2f4f4f]"COMMON"[/color][b][color=RED])[/color][/b] [b][color=RED]([/color][/b]assoc 8 ed[b][color=RED])[/color][/b] ed[b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]ssdel en ss[b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]princ [color=#2f4f4f]"\nPass #3...\n"[/color][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]setq cl nil[b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]and [b][color=NAVY]([/color][/b]setq ss [b][color=MAROON]([/color][/b]ssget [color=#2f4f4f]"X"[/color] [b][color=GREEN]([/color][/b]list [b][color=BLUE]([/color][/b]cons 0 [color=#2f4f4f]"LINE"[/color][b][color=BLUE])[/color][/b][b][color=BLUE]([/color][/b]cons 8 [color=#2f4f4f]"COMMON"[/color][b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b] [b][color=NAVY]([/color][/b]while [b][color=MAROON]([/color][/b]setq en [b][color=GREEN]([/color][/b]ssname ss 0[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]princ [color=#2f4f4f]"\r"[/color][b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]prin1 en[b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]setq ed [b][color=GREEN]([/color][/b]entget en[b][color=GREEN])[/color][/b] p10 [b][color=GREEN]([/color][/b]roundpt [b][color=BLUE]([/color][/b]cdr [b][color=RED]([/color][/b]assoc 10 ed[b][color=RED])[/color][/b][b][color=BLUE])[/color][/b] 8[b][color=GREEN])[/color][/b] p11 [b][color=GREEN]([/color][/b]roundpt [b][color=BLUE]([/color][/b]cdr [b][color=RED]([/color][/b]assoc 11 ed[b][color=RED])[/color][/b][b][color=BLUE])[/color][/b] 8[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]if [b][color=GREEN]([/color][/b]not [b][color=BLUE]([/color][/b]or [b][color=RED]([/color][/b]member [b][color=PURPLE]([/color][/b]list p10 p11[b][color=PURPLE])[/color][/b] cl[b][color=RED])[/color][/b] [b][color=RED]([/color][/b]member [b][color=PURPLE]([/color][/b]list p11 p10[b][color=PURPLE])[/color][/b] cl[b][color=RED])[/color][/b][b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b] [b][color=GREEN]([/color][/b]setq cl [b][color=BLUE]([/color][/b]cons [b][color=RED]([/color][/b]list p10 p11[b][color=RED])[/color][/b] cl[b][color=BLUE])[/color][/b] cl [b][color=BLUE]([/color][/b]cons [b][color=RED]([/color][/b]list p11 p10[b][color=RED])[/color][/b] cl[b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b] [b][color=GREEN]([/color][/b]entdel en[b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b] [b][color=MAROON]([/color][/b]ssdel en ss[b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]if [b][color=NAVY]([/color][/b]setq ss [b][color=MAROON]([/color][/b]ssget [color=#2f4f4f]"X"[/color] '[b][color=GREEN]([/color][/b][b][color=BLUE]([/color][/b]8 . [color=#2f4f4f]"COMMON"[/color][b][color=BLUE])[/color][/b][b][color=GREEN])[/color][/b][b][color=MAROON])[/color][/b][b][color=NAVY])[/color][/b] [b][color=NAVY]([/color][/b]command [color=#2f4f4f]"_.CHPROP"[/color] ss [color=#2f4f4f]""[/color] [color=#2f4f4f]"_C"[/color] [color=#2f4f4f]"BYLAYER"[/color] [color=#2f4f4f]""[/color][b][color=NAVY])[/color][/b][b][color=FUCHSIA])[/color][/b] [b][color=FUCHSIA]([/color][/b]redraw[b][color=FUCHSIA])[/color][/b][b][color=BLACK])[/color][/b] It should work. -David Quote
teknomatika Posted September 8, 2011 Author Posted September 8, 2011 David, Now works. Solved the problem reported. As it is already solved. However I would prefer that the routine was acting only in a specific selection. Quote
pBe Posted September 8, 2011 Posted September 8, 2011 Neat idea David. It does behave like overkill also converting just the floating point and not the whole list is a better approach. while you're at it might as well add to your function to remove the first items of 10 and 11 to resolve direction issues. Quote
ReMark Posted September 8, 2011 Posted September 8, 2011 "As it is already solved. However I would prefer that the routine was acting only in a specific selection." Well that should, in theory, reduce the amount of time it takes the program to finish the task right? 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.