Multiple polyline ltscale???

Multiple polyline ltscale???

DC-MWA
Collaborator Collaborator
836 Views
3 Replies
Message 1 of 4

Multiple polyline ltscale???

DC-MWA
Collaborator
Collaborator

Hi gurus,

I am working on a little lisp that manipulates ltscale of all polylines on a certain layer.

I have the parts that set them all to 1.  I'm trying to set them all to a variable value instead of 1.

 

(setq dscl_math (/ (atoi lay_name_scale) (getvar "dimscale")));;variable

 

;;;;this sets to 1, instead of 1 i need to use "dscl_math"

((lambda (/ ss i)
(if (setq ss (ssget "x" (list (cons 0 "LWPOLYLINE") (cons 8 new_layer))))
(repeat (setq i (sslength ss))
(entmod (append (entget (ssname ss (setq i (1- i)))) '((48 . 1.))))
)
)
(princ)
)
)

 

I'm keep screwing it up??

dc

0 Likes
Accepted solutions (1)
837 Views
3 Replies
Replies (3)
Message 2 of 4

DC-MWA
Collaborator
Collaborator

This needs more explanation...

I need to get the ltscale of each polyline and mutilpy by the variable and then set the ltscale of each polyline to that new value.

 

I hope that makes sense.

0 Likes
Message 3 of 4

dlanorh
Advisor
Advisor
Accepted solution

Try this :

 

(if (setq ss (ssget "x" (list (cons 0 "LWPOLYLINE") (cons 8 new_layer))))
(repeat (setq i (sslength ss))
(setq obj (vlax-ename->vla-object (ssname ss (setq i (1- i)))))
(vlax-put-property obj 'linetypescale (* (vlax-get-property obj 'linetypescale) your_val))
);end_repeat
);end_if

your_val is the value you want to multiply by as a real number

 

Oops missed post 2, amended above code

I am not one of the robots you're looking for

0 Likes
Message 4 of 4

DC-MWA
Collaborator
Collaborator

Thank you. That worked perfectly!!!

0 Likes