Lineweight extracted with layers comes out wrong

Lineweight extracted with layers comes out wrong

Anonymous
Not applicable
675 Views
2 Replies
Message 1 of 3

Lineweight extracted with layers comes out wrong

Anonymous
Not applicable

How can I get the lineweight to come out as it is set in inches? this current code is extracting it as something else. New to the lisp world so sorry if this is an obvious question.

pkirkendall_1-1596636058579.png

pkirkendall_2-1596636132639.png

Here is the code I am using

 

(lambda ( x / w )
(if (minusp (setq w (vla-get-lineweight x)))
"DEFAULT"
(rtos (/ w 100.) 2 2)
)
)

Thank you for your help!!

0 Likes
676 Views
2 Replies
Replies (2)
Message 2 of 3

dlanorh
Advisor
Advisor

@Anonymous wrote:

(lambda ( x / w )
(if (minusp (setq w (vla-get-lineweight x)))
"DEFAULT"
(rtos (/ w 100.) 2 2)
)
)

Thank you for your help!!


(rtos (/ w 100.) 2 2) is the problem. It divides the returned linweight by 100 and displays it as a decimal with 2 decimal places

 

As a guess try (rtos w (getvar 'lunits) (getvar 'luprec)) or "lobby" to move to the metric system. 😉

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

0 Likes
Message 3 of 3

Sea-Haven
Mentor
Mentor

I did read some where how line weights are worked out steps of x. Not numbers.

0 Likes