Look at this web site: http://a-cad-emia.blogspot.com.es/2012/08/los-defectos-del-comando-longitud.html
any know why this works great in 2006, but hangs up in 2018?
thanks for any help,
Steve
(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)
)
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
;;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)
)
@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")
)
@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?
Works good Kent, was able to pick circle and change
circumference to match a picked line length.
Thank you!
Steve
@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.]
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]