I have a program that inserts a block and fills out the attributes. One of the attributes is the insertion point. Sort of like this:
(setq int(cdr(assoc 10 ent))) ;Gets the insertion point. At this point the value of int = (6.44871e+006 1.92463e+008 0.0)
When the block gets inserted:
(command "INSERT" "MyBlock" "XSCALE" SYMSCALE "YSCALE" SYMSCALE int rot qty int ) ; qty is one attribute value and int is the other. After it's inserted the value of this attribute = 6.448797609824417E+006,1.924629241711203E+008
Which is right on the money.
That's the first thing I don't understand. What happened to 0.0?
I am writing a program that has to update this value without replacing the block. I use:
(setq ADDINS(cdr(assoc 10 AENTL))) ;Gets the ins point
(setq X_VAL(rtos(car ADDINS)1 7)) ;Gets the X Value and turns it into a string
(setq Y_VAL(rtos(cadr ADDINS)1 6)) ;Gets the Y Value and turns it into a string
(setq ADDINN(strcat X_VAL "," Y_VAL )) ;Creates and comma delimited X,Y
At this point the value of ADDINN is 6.4487057E+06,1.924629E+08 which is a little off.
So I tried:
(setq X_VAL(rtos(car ADDINS)2 7))
(setq Y_VAL(rtos(cadr ADDINS)2 6))
(setq ADDINN(strcat X_VAL "," Y_VAL ))
To set it to a decimal value and it get this for a value:
6448372.2599400,192462646.790151 which is way off.
Is there any way I can get the original attribute value that Acad creates when the block gets inserted?
If you need more info please let me know and thanks in advance for any advice.