Visual LISP, AutoLISP and General Customization

Reply
Contributor
markr
Posts: 19
Registered: ‎04-11-2002
Message 1 of 5 (101 Views)

Read/Modify dimension precision

101 Views, 4 Replies
12-11-2000 03:10 AM
Our A2Ki drawings have only one dimension style.
But within any of these drawing, the precision of
any given dimension may be changed from the default
of two decimal places to three or four. I can access
the DIMDEC system variable, but cannot seem to find
a way in LISP to read or modify the precision setting
of any individual dimension. Is this possible?

Thanks
Mark
*Middleton, Cliff
Message 2 of 5 (101 Views)

Re: Read/Modify dimension precision

12-11-2000 04:53 AM in reply to: markr
Assuming the dimEnt is the ename of the dimension entity, calling (setq
edata (entget dimEnt '("ACAD"))) will retrieve the entity data plus the
extended entity data where AutoCAD stores dimension overrides (example
below). The extended data is in the "ACAD" group inside the -3 group. Step
thru the list until you get to (1070 . 271). The 1070 group following (1070
. 271) is the DIMDEC override value.

((-1 . ) (0 . "DIMENSION") (330 .
18120c8>)
(5 . "1C61") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "QKEYS")
(100 .
"AcDbDimension") (2 . "*D8") (10 -6.00224 -3.5412 0.0) (11 -6.31474 -3.38745
0.0) (12 0.0 0.0 0.0) (70 . 32) (1 . "") (71 . 5) (72 . 1) (41 . 1.0) (42 .
0.625) (52 . 0.0) (53 . 0.0) (54 . 0.0) (51 . 0.0) (210 0.0 0.0 1.0) (3 .
"STANDARD") (100 . "AcDbAlignedDimension") (13 -6.62724 -2.8125 0.0) (14
-6.00224 -2.8125 0.0) (15 0.0 0.0 0.0) (16 0.0 0.0 0.0) (40 . 0.0) (50 .
0.0)
(100 . "AcDbRotatedDimension") (-3 ("ACAD" (1000 . "DSTYLE") (1002 . "{")
(1070
. 40) (1040 . 1.5) (1070 . 271) (1070 . 1) (1002 . "}"))))

Cliff

markr wrote in message news:ef59afe.-1@WebX.SaUCah8kaAW...
| Our A2Ki drawings have only one dimension style.
| But within any of these drawing, the precision of
| any given dimension may be changed from the default
| of two decimal places to three or four. I can access
| the DIMDEC system variable, but cannot seem to find
| a way in LISP to read or modify the precision setting
| of any individual dimension. Is this possible?
| Thanks
| Mark
|
|
*Middleton, Cliff
Message 3 of 5 (101 Views)

Re:

12-11-2000 05:08 AM in reply to: markr
Here's a start. Modify it to suit your purposes.

(defun getdec (ename / edata xdata done)
(if
(and
(setq edata (entget ename '("ACAD")))
(setq xdata (cdr (assoc -3 edata)))
(setq xdata (cdr (assoc "ACAD" xdata)))
(setq xdata (member '(1070 . 271) xdata))
)
(cdadr xdata)
)
)

Cliff

Cliff Middleton wrote in message
news:3216A29F7F4AE11758E4D01683A37505@in.WebX.SaUCah8kaAW...
| Assuming the dimEnt is the ename of the dimension entity, calling (setq
| edata (entget dimEnt '("ACAD"))) will retrieve the entity data plus the
| extended entity data where AutoCAD stores dimension overrides (example
| below). The extended data is in the "ACAD" group inside the -3 group.
Step
| thru the list until you get to (1070 . 271). The 1070 group following
(1070
| . 271) is the DIMDEC override value.
|
| ((-1 . ) (0 . "DIMENSION") (330 .
| 18120c8>)
| (5 . "1C61") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "QKEYS")
| (100 .
| "AcDbDimension") (2 . "*D8") (10 -6.00224 -3.5412 0.0)
(11 -6.31474 -3.38745
| 0.0) (12 0.0 0.0 0.0) (70 . 32) (1 . "") (71 . 5) (72 . 1) (41 . 1.0) (42
.
| 0.625) (52 . 0.0) (53 . 0.0) (54 . 0.0) (51 . 0.0) (210 0.0 0.0 1.0) (3 .
| "STANDARD") (100 . "AcDbAlignedDimension") (13 -6.62724 -2.8125 0.0) (14
| -6.00224 -2.8125 0.0) (15 0.0 0.0 0.0) (16 0.0 0.0 0.0) (40 . 0.0) (50 .
| 0.0)
| (100 . "AcDbRotatedDimension") (-3 ("ACAD" (1000 . "DSTYLE") (1002 . "{")
| (1070
| . 40) (1040 . 1.5) (1070 . 271) (1070 . 1) (1002 . "}"))))
|
| Cliff
|
| markr wrote in message
news:ef59afe.-1@WebX.SaUCah8kaAW...
| | Our A2Ki drawings have only one dimension style.
| | But within any of these drawing, the precision of
| | any given dimension may be changed from the default
| | of two decimal places to three or four. I can access
| | the DIMDEC system variable, but cannot seem to find
| | a way in LISP to read or modify the precision setting
| | of any individual dimension. Is this possible?
| | Thanks
| | Mark
| |
| |
|
Contributor
markr
Posts: 19
Registered: ‎04-11-2002
Message 4 of 5 (101 Views)

Re:

12-12-2000 12:24 AM in reply to: markr
Cliff

(setq edata (entget ename '("ACAD"))) returns the message
bad arguement type. Also, I cannot seem to find any -3
group codes.

MR
*Middleton, Cliff
Message 5 of 5 (101 Views)

Re:

12-12-2000 10:07 PM in reply to: markr
Is ename set to a valid entity name? Try this...

(setq ename (car (entsel "Select a dimension")))

(getdec ename)

Entget will not return the -3 codes unless you pass it the application name
that assigned them (in this case "ACAD"). If there are no -3 codes, then
the dimension has no overrides.

markr wrote in message news:ef59afe.2@WebX.SaUCah8kaAW...
| Cliff
| (setq edata (entget ename '("ACAD"))) returns the message
| bad arguement type. Also, I cannot seem to find any -3
| group codes.
|
| MR
|
|

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community