Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Trim to polyline midpoint when selecting unwanted polyline half

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
stephenhicks.sub
847 Views, 6 Replies

Trim to polyline midpoint when selecting unwanted polyline half

Hello. Is there a command that trims to a polyline midpoint when selecting an unwanted polyline half?

 

Thank you.

Labels (1)
6 REPLIES 6
Message 2 of 7


@stephenhicks.sub wrote:

.... Is there a command that trims to a polyline midpoint when selecting an unwanted polyline half? ....


If you can be counted on to select it in an unambiguous location [where nothing else might be "seen" instead], something like this [minimally tested]:

(defun C:PLCHO ; = PolyLine Cut Half Off
  (/ plsel)
  (setq plsel (entsel "\nSelect Polyline within half-length to be cut off: "))
  (command "_.lengthen" "_total"
    (/ (vlax-curve-getDistAtParam (car plsel) (vlax-curve-getEndParam (car plsel))) 2)
    (cadr plsel) ""
  ); command
  (princ)
); defun

 

Kent Cooper, AIA
Message 3 of 7

That's it! Thanks, Kent.

Message 4 of 7

As length is a property can also do this way.

 

Thanks Kent learn something new all the time "Lengthen"

 

 

(command "_.lengthen" "_total"
    (/ (vlax-get (vlax-ename->vla-object (car plsel)) 'Length) 2)
    (cadr plsel) ""
  ); command

 

Message 5 of 7
ВeekeeCZ
in reply to: Sea-Haven

Yes, one of my favorites commands. The command also has the "percent" option...

 

(defun c:PLCHO ()
  (command "_.lengthen" "_percent" 50)
  (princ)
  )

 

Message 6 of 7
Sea-Haven
in reply to: ВeekeeCZ

Nice % and pick a side to remove.

Message 7 of 7

Hello @stephenhicks.sub !

 

Great to see you here on LISP forum.

And you already received a solution! This is awesome!

 

Don't hesitate to ask any question you have by creating a new thread.

Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям! | Do you find the posts helpful? "LIKE" these posts!
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.



Лена Талхина/Lena Talkhina
Менеджер Сообщества - Русский/Community Manager - Russian

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost