- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello, I am trying to create a function which reads a dimension and changes the dimension precision to the minimum amount with _AIDIMPREC:
e.g. 12.345000 --> 12.345
12.000 --> 12
12.345678 --> 12.345678
The code I have right now is as so:
^C^C^P(SETQ EN (CAR (ENTSEL "Select Dimention: "))
VAL (CDR (ASSOC 42 (ENTGET EN)))
COUNTER 6
CHECKER 6)
\(WHILE (> CHECKER 0)
(SETQ VALTEMP (RTOS VAL 2 COUNTER)
VALLEN (STRLEN VALTEMP)
SUBSTRING (SUBSTR VALTEMP VALLEN 1)
COUNTER (IF (EQUAL SUBSTRING "0") (- COUNTER 1) (* COUNTER 1))
CHECKER (IF (/= SUBSTRING "0") (- CHECKER 100) (- CHECKER 1))))
^C(COMMAND "._AIDIMPREC" COUNTER EN "") ^C^C^P
This does work, but it can only choose and affect one dimension at a time.
Is there a way to allow this function to affect multiple dimensions, all chosen at once?
would: (ssget '((0 . "DIMENSION"))) work? and if so, how do I allow each selected object to be affected by my function?
I just starting with AutoCAD LISP, so any help would be really helpful. Thank you.
Solved! Go to Solution.