Afternoon everyone,
I am playing with a point list of some zero length arcs, and wanting to put circles in place of these zero length arcs.
So I am pulling the DXF code 10 to get the center point.
There are times however (I don't understand how this is working) when the point value has a negative X value even though the zero length arc is clearly in the positive.
So, for example, I have the DXF code 10 of a zero length arc:
(10 -443.597 275.719 0.0)
but in reality, the arc is sitting at:
(10 443.597 275.719 0.0)
I am disecting this list and want to change the negative value to a positive and then recreate the list.
By pulling the X value out:
(setq a (cdr (assoc 10 <the object>)))
(setq b (car a))
!b -443.597
So I was thinking I would have to convert this to a string, then use SUBST to strip the negative from the value, then convert back to a number and create a new list to use for the location of the circle.
If I use RTOS, I get
"-36'-11 19/32\""
and I don't know that I want that, although it shouldn't matter as the value is not changing, merely the negative value.
But, is there a better way to go about doing this ??
I haven't got the code done yet, ... I'm trying to think ahead before spending too much time. Here's what I do have so far:
< ... >
(while (setq Obj (ssname SS (setq i (1+ i))))
(if (setq eList (entget Obj))
(progn
(setq objAnglS (cdr (assoc 50 eList))
objAnglE (cdr (assoc 51 eList)))
(if (equal objAnglS objAnglE 0.001)
(progn
(setq objLayr (cdr (assoc 8 eList))
objColr (cdr (assoc 62 eList))
objLTyp (cdr (assoc 6 eList))
objLWgt (cdr (assoc 370 eList))
objCtrPT (cdr (assoc 10 eList))
objRad (cdr (assoc 40 eList))
)
(CheckNegativeValue)
< ... >
(defun CheckNegativeValue (/ )
(setq objCtrPT-X (car objCtrPT)
objCtrPT-Y (car (cdr objCtrPT)))
(if (minusp objCtrPT-X)
( ...
And my psuedo code:
; if x is negative and y is negative
; then do nothing
;
; if x is negative and y positive
; then make x positive
; recreate point list
;
; if y is negative and x positive
; then make y positive
; recreate point list
Anyway; thoughts, questions, suggestions, ideas, etc. are always welcome. Thank you.