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

change length to match length

14 REPLIES 14
Reply
Message 1 of 15
Anonymous
1571 Views, 14 Replies

change length to match length

Anybody have a command to make a line change length to match length of a
line, arc, polyline or circle? Could use this when making flat patterns
layouts. Thanks for any help Steve
14 REPLIES 14
Message 2 of 15
Anonymous
in reply to: Anonymous

Could be done with a little LISP ... but it would take a bit more
information about the line: would you want it to remain at the same angle,
or would that change as well? Which end would you want to extend/shorten? Or
would you like to add the same amount on both ends?
___

"Steve Bose" wrote in message
news:7D3B66E5FBBFCE25D310D9FB971810D8@in.WebX.maYIadrTaRb...
> Anybody have a command to make a line change length to match length of a
> line, arc, polyline or circle? Could use this when making flat patterns
> layouts. Thanks for any help Steve
>
>
Message 3 of 15
Anonymous
in reply to: Anonymous

Paul,
Thanks for the reply. Would like it to work like the lengthen total
command, where the end you pick changes with line staying at same angle.

Thanks,
Steve


Paul Turvill wrote in message
news:7A8D40B59353F6DBCED9BC553D058B96@in.WebX.maYIadrTaRb...
> Could be done with a little LISP ... but it would take a bit more
> information about the line: would you want it to remain at the same angle,
> or would that change as well? Which end would you want to extend/shorten?
Or
> would you like to add the same amount on both ends?
> ___
>
> "Steve Bose" wrote in message
> news:7D3B66E5FBBFCE25D310D9FB971810D8@in.WebX.maYIadrTaRb...
> > Anybody have a command to make a line change length to match length of a
> > line, arc, polyline or circle? Could use this when making flat patterns
> > layouts. Thanks for any help Steve
> >
> >
>
>
Message 4 of 15
Anonymous
in reply to: Anonymous

Quick & dirty -- easiest way seemed to be to just use the LENGTHEN command:

(defun C:ASLONGAS (/ cmde obj len)
(setq cmde (getvar "cmdecho"))
(setvar "cmdecho" 0)
(setq obj (car (entsel "\nSelect object to measure: ")))
(command "_.lengthen" obj "")
(setq len (getvar "perimeter"))
(prompt "\nPick end of line to change: ")
(command "_.lengthen" "_t" len pause "")
(setvar "cmdecho" cmde)
(princ)
)

No error checking, but it works as you describe on most objects. Feel free
to modify & refine as you see fit.
___

"Steve Bose" wrote in message
news:13B398086E8D2508C05493B48C486A81@in.WebX.maYIadrTaRb...
> Paul,
> Thanks for the reply. Would like it to work like the lengthen total
> command, where the end you pick changes with line staying at same angle.
>
> Thanks,
> Steve
>
>
> Paul Turvill wrote in message
> news:7A8D40B59353F6DBCED9BC553D058B96@in.WebX.maYIadrTaRb...
> > Could be done with a little LISP ... but it would take a bit more
> > information about the line: would you want it to remain at the same
angle,
> > or would that change as well? Which end would you want to
extend/shorten?
> Or
> > would you like to add the same amount on both ends?
> > ___
> >
> > "Steve Bose" wrote in message
> > news:7D3B66E5FBBFCE25D310D9FB971810D8@in.WebX.maYIadrTaRb...
> > > Anybody have a command to make a line change length to match length of
a
> > > line, arc, polyline or circle? Could use this when making flat
patterns
> > > layouts. Thanks for any help Steve
> > >
> > >
> >
> >
>
>
Message 5 of 15
Anonymous
in reply to: Anonymous

Paul,
Thank you very much, it works great.

Steve

Paul Turvill wrote in message
news:31D10002CD4E467755A79D766552F9BB@in.WebX.maYIadrTaRb...
> Quick & dirty -- easiest way seemed to be to just use the LENGTHEN
command:
>
> (defun C:ASLONGAS (/ cmde obj len)
> (setq cmde (getvar "cmdecho"))
> (setvar "cmdecho" 0)
> (setq obj (car (entsel "\nSelect object to measure: ")))
> (command "_.lengthen" obj "")
> (setq len (getvar "perimeter"))
> (prompt "\nPick end of line to change: ")
> (command "_.lengthen" "_t" len pause "")
> (setvar "cmdecho" cmde)
> (princ)
> )
>
> No error checking, but it works as you describe on most objects. Feel free
> to modify & refine as you see fit.
> ___
>
> "Steve Bose" wrote in message
> news:13B398086E8D2508C05493B48C486A81@in.WebX.maYIadrTaRb...
> > Paul,
> > Thanks for the reply. Would like it to work like the lengthen total
> > command, where the end you pick changes with line staying at same angle.
> >
> > Thanks,
> > Steve
> >
> >
> > Paul Turvill wrote in message
> > news:7A8D40B59353F6DBCED9BC553D058B96@in.WebX.maYIadrTaRb...
> > > Could be done with a little LISP ... but it would take a bit more
> > > information about the line: would you want it to remain at the same
> angle,
> > > or would that change as well? Which end would you want to
> extend/shorten?
> > Or
> > > would you like to add the same amount on both ends?
> > > ___
> > >
> > > "Steve Bose" wrote in message
> > > news:7D3B66E5FBBFCE25D310D9FB971810D8@in.WebX.maYIadrTaRb...
> > > > Anybody have a command to make a line change length to match length
of
> a
> > > > line, arc, polyline or circle? Could use this when making flat
> patterns
> > > > layouts. Thanks for any help Steve
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Message 6 of 15
JoseVicario
in reply to: Anonymous
Message 7 of 15
steven.bose
in reply to: Anonymous

any know why this works great in 2006, but hangs up in 2018?

thanks for any help,

Steve

Message 8 of 15
pbejse
in reply to: steven.bose

(defun C:ASLONGAS (/ cmde obj len)
  (setq cmde (getvar "cmdecho"))
  (setvar "cmdecho" 0)
  (setq obj (car (entsel "\nSelect object to measure: ")))
  (setq len (vlax-curve-getDistAtParam obj
                      (vlax-curve-getEndParam obj)
                    )
	)
  (prompt "\nPick end of line to change: ")
   (command "_.lengthen" "_t" len)
  		(while (> (getvar 'cmdactive) 0) (command pause))
  	(command)
  (setvar "cmdecho" cmde)
  (princ)
)
Message 9 of 15
steven.bose
in reply to: pbejse

Works great! thank you very much!

 

Would be cool if it could change a circle circumference to match a line length also if possible.

 

thanks again,

Steve

Message 10 of 15
steven.bose
in reply to: Anonymous

;;changed one line to work on 2018, thank you Kent Cooper

 

(defun C:ASLONGAS (/ cmde obj len)
(setq cmde (getvar "cmdecho"))
(setvar "cmdecho" 0)
(setq obj (car (entsel "\nSelect object to measure: ")))
;;(command "_.lengthen" obj "")

(command "_.lengthen" obj nil);;changed per Kent Cooper for 2018
(setq len (getvar "perimeter"))
(prompt "\nPick end of line to change: ")
(command "_.lengthen" "_t" len pause "")
(setvar "cmdecho" cmde)
(princ)
)

Message 11 of 15
Kent1Cooper
in reply to: steven.bose


@steven.bose wrote:

....

Would be cool if it could change a circle circumference to match a line length also if possible.

....


That needs a different approach, since LENGTHEN can't be applied to a Circle.  One way to do it, in simplest terms:

 

(setpropertyvalue

  (car (entsel "\nSelect Circle to change circumference: "))

  "Circumference"

  (getpropertyvalue (car (entsel "\nSelect Line for length: ")) "Length")

)

Kent Cooper, AIA
Message 12 of 15
pbejse
in reply to: steven.bose


@steven.bose wrote:

Would be cool if it could change a circle circumference to match a line length also if possible.


Yeah, that would be nice isnt it? 

 

Message 13 of 15
steven.bose
in reply to: Kent1Cooper

Works good Kent, was able to pick circle and change

circumference to match a picked line length.

Thank you!

Steve

Message 14 of 15
Kent1Cooper
in reply to: steven.bose


@steven.bose wrote:

Works good Kent, was able to pick circle and change

circumference to match a picked line length.

Thank you!


You're welcome.  For the source object for the length to impose on the Circle, you can also pick a Polyline or an Arc, because they also have the same "Length" property under the (get/setpropertyvalue) system.  [But not an Ellipse or Spline.]

Kent Cooper, AIA
Message 15 of 15
Sea-Haven
in reply to: Anonymous

Why not use a cond for the length is it Line,arc,lwpolyline then length or Circle then circumference ?

 

Ps no getproperty in Bricscad.

; (GETPROPERTYVALUE (CAR (ENTSEL "Select Line for length: ")) "Length")
; error : no function definition <GETPROPERTYVALUE> ; expected FUNCTION at [eval]

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

Post to forums  

Autodesk Design & Make Report

”Boost