TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: AwAD on October 29, 2018, 06:19:37 PM
-
hello every one,
I've tried the (command "extend" boundary-entity "" line-entity "") that only extended one end,
is there is a way to do both ends without the user selecting them ?
-
Try this
x_ent
(car (entsel "\nSelect Line to Extend : ")) )
)
-
thank's a lot for your effort,
I tried a similar concept, however (nentselp) doesn't work most of the time unfortunately.
It's related to the current view and the zoom level, even when changing 'pickpox system variable to 1, It's still unreliable, And to 0 it fail's to select half of the time.
-
You could try temporarily to zoom on the bounding box of the "boundary object" (focus) -
(defun C:test
( / e1 e2 p1 p2 cad
) )
)
)
)
-
Testing a bit, more reliable would be to zoom on the pair of objects, since focusing on one won't guarantee successful extend to the other:
(defun C:test
( / e1 e2 p1 p2 cad
) )
(
); foreach
)
)
)
)
)
)
)
)
-
Testing a bit, more reliable would be to zoom on the pair of objects, since focusing on one won't guarantee successful extend to the other:
(defun C:test
( / e1 e2 p1 p2 cad
) )
(
); foreach
)
)
)
)
)
)
)
)
THANK YOU VERY MUCH,
that works great.
:yay!:
-
THANK YOU VERY MUCH,
that works great.
:yay!:
Thanks, however address that to Dlanor.. I couldn't figure out the nentselp trick within a command call bymyself :roll:
And the zooming stuff are not that hard to implement.
-
It’s very easy started to do something, you just pick outside pline then inside pline and do a intersectwith with extend option and it returns the two new intersection points as a list. You then just redo the pline co-ores. I started at home using this and just had to sort out the build new pline co-ores list and you just vlax-putcoordinates. On a IPad at moment wil try later when home to finish pushed for time and moment.
-
I would avoid nentselp. Creating your own 'entsel-list' is probably more reliable:
(defun c:ExtendBothEnds
( / e1 e2
) )
"_extend"
e1
""
""
)
)
)
)
-
I would avoid nentselp. Creating your own 'entsel-list' is probably more reliable:
I like that Roy!
..unfortunately no like button to hit for your post, so :thumbsup:
-
Try this would appreciate to know if it works with arcs.
(defun c:plout ( / obj1 obj2 co-ords x y lst)
(setq obj1 (vlax-ename->vla-object (car (entsel "Pick outside object"))))
(setq obj2 (vlax-ename->vla-object (car (entsel "Pick inner object"))))
(setq intpt (vlax-invoke obj2 'intersectWith obj1 acExtendThisEntity))
(setq co-ords (vlax-safearray->list (vlax-variant-value (vlax-get-property obj2 'Coordinates))))
(setvar 'osmode 0)
(setq lst '())
(setq lst (cons (nth 1 intpt)lst))
(setq lst (cons (nth 0 intpt)lst))
(setq x (/ (length co-ords)2))
(setq y 2)
(repeat (- x 2)
(setq lst (cons (nth (+ y 1) co-ords)lst))
(setq lst (cons (nth y co-ords)lst))
(setq y (+ y 2))
)
(setq lst (cons (nth 4 intpt)lst))
(setq lst (cons (nth 3 intpt)lst))
(vlax-put obj2 'Coordinates lst)
)
(c:plout)
-
Try this would appreciate to know if it works with arcs.
Yes that works great :yes:.
THANK YOU.
It even fix the issue when one end of the inner polyline is not inside the outer one, "intersecting with it". :yay!:
However when the inner polyline have arc in it or is just an arc, some times it works great, others strange things happen like
flipping the arc "it's center is mirrored to the other direction", the polyline is changed completely that i couldn't understand what happened.
The Previous solution is also great, however when their is an end that is outside and also the end of an arc, It is extended all the way around to the other side of the outer creating a giant circle :cry:.
I attached a sample file if you want to try.
Finally I searched online and came up with a not very efficient solution witch is to extend all the inner lines with a known amount, Then breaking them at their intersection points with the outer lines, After that deleting all the lines that are shorter than or equal to the known amount.
THANKS VERY MUCH TO ALL YOU WHO HELPED ME, I LEARNED A LOT FROM YOU IN THAT TOPIC.