F
Frankie Golaub
Hi,
I want to create a toggle for scaling a drawing based on the radius of a
circle at a known insertion point. If the radius = 10000.000 then I scale
the drawing to 10001.177 and vice versa.
However, I seem to be having a problem determining the radius of the circle.
My test code is as follows:
(DEFUN GRSCALE ()
(command "layer" "on" "geo" "")
(SETQ SEL (SSGET "X" '((0 . "CIRCLE")(8 . "GEO")(10 329061.399 4772506.537
0.000)))))
(SETQ NA (SSLENGTH SEL))
(SETQ INDEX 0)
(REPEAT NA
(SETQ B1 (ENTGET (SSNAME SEL INDEX)))
(SETQ INDEX (+ INDEX 1))
(SETQ C (ASSOC 40 B1))
(SETQ D (RTOS (CDR C) 2 3))
(IF (= "10001.177" D)
(PROMPT "THIS DRAWING IS SET TO GRIDSCALE" )
)
(IF (= "10000.000" D)
(PROMPT "THIS DRAWING IS SET TO GROUNDSCALE")
)
)
)
My drawing units are set to decimal and are to 3 decimal places. The actual
radii are not exactly 10000.000 and 100001.177 which is why I used RTOS to
round up the figures.
But when I check the entity list the numbers are only one decimal place and
are expressed as engineering units
ie. (10 329061.0 4.77251e+006 0.0) and (40 . 10000.0)
So even though the circle exists I get a nil return.
I think that the problem lies in the different units but i'm not sure how to
get past it.
Thanks In Advance.
Frankie Golaub
I want to create a toggle for scaling a drawing based on the radius of a
circle at a known insertion point. If the radius = 10000.000 then I scale
the drawing to 10001.177 and vice versa.
However, I seem to be having a problem determining the radius of the circle.
My test code is as follows:
(DEFUN GRSCALE ()
(command "layer" "on" "geo" "")
(SETQ SEL (SSGET "X" '((0 . "CIRCLE")(8 . "GEO")(10 329061.399 4772506.537
0.000)))))
(SETQ NA (SSLENGTH SEL))
(SETQ INDEX 0)
(REPEAT NA
(SETQ B1 (ENTGET (SSNAME SEL INDEX)))
(SETQ INDEX (+ INDEX 1))
(SETQ C (ASSOC 40 B1))
(SETQ D (RTOS (CDR C) 2 3))
(IF (= "10001.177" D)
(PROMPT "THIS DRAWING IS SET TO GRIDSCALE" )
)
(IF (= "10000.000" D)
(PROMPT "THIS DRAWING IS SET TO GROUNDSCALE")
)
)
)
My drawing units are set to decimal and are to 3 decimal places. The actual
radii are not exactly 10000.000 and 100001.177 which is why I used RTOS to
round up the figures.
But when I check the entity list the numbers are only one decimal place and
are expressed as engineering units
ie. (10 329061.0 4.77251e+006 0.0) and (40 . 10000.0)
So even though the circle exists I get a nil return.
I think that the problem lies in the different units but i'm not sure how to
get past it.
Thanks In Advance.
Frankie Golaub