DIM Lisp routine

DIM Lisp routine

Anonymous
Not applicable
897 Views
25 Replies
Message 1 of 26

DIM Lisp routine

Anonymous
Not applicable
I am not a real lisp expert, but I have written a number of routines which I
use in everyday work. I have been trying to do the following:
Select a dimension from on screen and have autocad change to that layer
and set dtimscale equal to the picked object . I've been able to do the
layer part, but have not been able to retrieve the dimscale in a usable
form.
Any help would be appreciated.
Thanks
Clifford Leblang
0 Likes
898 Views
25 Replies
Replies (25)
Message 2 of 26

Anonymous
Not applicable
It takes a couple of steps. After you select the dimension, you'll find
the dimstyle in dxf group 3, i.e.,

(setq dimstl (cdr (assoc 3 ent)))

Given this, you need to search the Dimstyle Table to determine the
dimscale assigned to that style:

(setq dimscl (cdr (assoc 40 (tblsearch "dimstyle" dimstl))))

This assumes, of course, that the selected dimension uses the dimscale
assigned to its style, and wasn't overridden.
___
"Clifford Leblang" wrote in message
news:[email protected]...
> I am not a real lisp expert, but I have written a number of routines
which I
> use in everyday work. I have been trying to do the following:
> Select a dimension from on screen and have autocad change to that layer
> and set dtimscale equal to the picked object . I've been able to do
the
> layer part, but have not been able to retrieve the dimscale in a usable
> form.
> Any help would be appreciated.
> Thanks
> Clifford Leblang
>
>
0 Likes
Message 3 of 26

Anonymous
Not applicable
I am not a real lisp expert, but I have written a number of routines which I
use in everyday work. I have been trying to do the following:
Select a dimension from on screen and have autocad change to that layer
and set dtimscale equal to the picked object . I've been able to do the
layer part, but have not been able to retrieve the dimscale in a usable
form.
Any help would be appreciated.
Thanks
Clifford Leblang
0 Likes
Message 4 of 26

Anonymous
Not applicable
This might not be the best way. But, couldn't you find the dimension style
of the selected dimension, then set the current dimension style to that
(via something like (command "dim" "res" selected_dim)). Now do (getvar
"dimscale") this should return the dimscale of the current dimstyle
(atleast it works that way in R12).

Just a thought. 🙂
--
Kevin Nehls
for reply remove -ns-

Clifford Leblang wrote in article
<[email protected]>...
> I am not a real lisp expert, but I have written a number of routines
which I
> use in everyday work. I have been trying to do the following:
> Select a dimension from on screen and have autocad change to that layer
> and set dtimscale equal to the picked object . I've been able to do the
> layer part, but have not been able to retrieve the dimscale in a usable
> form.
> Any help would be appreciated.
> Thanks
> Clifford Leblang
>
>
>
>
>
0 Likes
Message 5 of 26

Anonymous
Not applicable
Kevin,
Thanks for your quick reply, but what I believe you're suggesting won't work
in this case. I have my sysvar "dimscale" set to zero, so that dimensions
created in "floating model space" (as it used to be called??) will
automatically be created with an override to match the scale of the
viewport. Then, working in (tiled) model space, I would want to add
additional dimensions which will show in that paper space viewport at the
correct scale. This can of course be accomplished manually, but I'm looking
for a way to automate the process.
thanks,
Cliff

Kevin Nehls wrote in message
news:01bf7a6f$2c93b760$6b0c10ac@toc0156...
> This might not be the best way. But, couldn't you find the dimension
style
> of the selected dimension, then set the current dimension style to that
> (via something like (command "dim" "res" selected_dim)). Now do (getvar
> "dimscale") this should return the dimscale of the current dimstyle
> (atleast it works that way in R12).
>
> Just a thought. 🙂
> --
> Kevin Nehls
> for reply remove -ns-
>
> Clifford Leblang wrote in article
> <[email protected]>...
> > I am not a real lisp expert, but I have written a number of routines
> which I
> > use in everyday work. I have been trying to do the following:
> > Select a dimension from on screen and have autocad change to that layer
> > and set dtimscale equal to the picked object . I've been able to do the
> > layer part, but have not been able to retrieve the dimscale in a usable
> > form.
> > Any help would be appreciated.
> > Thanks
> > Clifford Leblang
> >
> >
> >
> >
> >
0 Likes
Message 6 of 26

Anonymous
Not applicable
Clifford,

If I understand correctly, you want to get the dimscale of a selected
dimension. If the dimension does not have a dimscale override, then you can
obtain dimscale by getting the dimension style name and then using the
combination of "tblobject" and "entget" on the dimstyle name. However, if
the selected dimension has a dimscale override, then you will need to get
your scale via the "entsel" function with the "applist" option.

Below is a example:

(defun c:test ( / ent applist dimscale dimstyle dimstyledata)
(setq ent (entsel "\nSelect a dimension: "))
(if
(and
ent
(= "DIMENSION" (cdr (assoc 0 (setq ent (entget (car ent)
'("ACAD"))))))
)
(if
(and
(setq applist (assoc -3 ent))
(setq applist (assoc 1040 (cdadr applist)))
)
(setq dimscale (cdr applist))
(progn
(setq dimstyle (cdr (assoc 3 ent)))
(setq dimstyledata (entget (tblobjname "DIMSTYLE" dimstyle )))
(setq dimscale (cdr (assoc 40 dimstyledata)))
)
)
(progn
(princ "\nPlease try again. ")
(princ)
)
)
)

Hope that helps.

Regards,
Steve Doman

"Clifford Leblang" wrote:
> I am not a real lisp expert, but I have written a number
> of routines which I use in everyday work. I have been
> trying to do the following: Select a dimension from on
> screen and have autocad change to that layer and set
> dtimscale equal to the picked object . I've been able to
> do the layer part, but have not been able to retrieve the
> dimscale in a usable form.
> Any help would be appreciated.
> Thanks
> Clifford Leblang
0 Likes
Message 7 of 26

Anonymous
Not applicable
Steve,
Thank you, Thank you
I believe you have solved my problem. I tested your routine quick quick in
Acad
and it indeed returns to dimscale needed (except if dimscale = 1, it seems
to return nil)
I don't quite understand this, but I'll try to incorporate the routine into
the lisp program I've been trying to write. I hope its OK to use your
routine, and share it around the office. I'll let you know if all is
successful.
Thanks again
Cliff

Steve Doman wrote in message
news:[email protected]...
> Clifford,
>
> If I understand correctly, you want to get the dimscale of a selected
> dimension. If the dimension does not have a dimscale override, then you
can
> obtain dimscale by getting the dimension style name and then using the
> combination of "tblobject" and "entget" on the dimstyle name. However, if
> the selected dimension has a dimscale override, then you will need to get
> your scale via the "entsel" function with the "applist" option.
>
> Below is a example:
>
>
> (defun c:test ( / ent applist dimscale dimstyle dimstyledata)
> (setq ent (entsel "\nSelect a dimension: "))
> (if
> (and
> ent
> (= "DIMENSION" (cdr (assoc 0 (setq ent (entget (car ent)
> '("ACAD"))))))
> )
> (if
> (and
> (setq applist (assoc -3 ent))
> (setq applist (assoc 1040 (cdadr applist)))
> )
> (setq dimscale (cdr applist))
> (progn
> (setq dimstyle (cdr (assoc 3 ent)))
> (setq dimstyledata (entget (tblobjname "DIMSTYLE" dimstyle )))
> (setq dimscale (cdr (assoc 40 dimstyledata)))
> )
> )
> (progn
> (princ "\nPlease try again. ")
> (princ)
> )
> )
> )
>
> Hope that helps.
>
> Regards,
> Steve Doman
>
>
> "Clifford Leblang" wrote:
> > I am not a real lisp expert, but I have written a number
> > of routines which I use in everyday work. I have been
> > trying to do the following: Select a dimension from on
> > screen and have autocad change to that layer and set
> > dtimscale equal to the picked object . I've been able to
> > do the layer part, but have not been able to retrieve the
> > dimscale in a usable form.
> > Any help would be appreciated.
> > Thanks
> > Clifford Leblang
>
>
>
0 Likes
Message 8 of 26

Anonymous
Not applicable
Clifford,

Glad to have helped and please use the code any way you
wish. It was an interesting problem.

I don't know why the routine returns nill when dimscale
equal to 1 for I am unable to reproduce that error. I've
tested the routine on a dimension where the dimscale (equal
to 1) was controlled by the dimstyle. And I also tested on
a dimension where the dimcale was controlled by a user
applied dimoverride, as well as an AutoCAD applied
dimoverride (per vport where the dimstyle's dimscale is set
at 0 and the vport vscale is 1).

Perhaps you can send me a small drawing with the problematic
dimension? If so, please send to the address below.

Thanks,

Steve Doman
[email protected]

"Clifford Leblang" wrote:
> Steve,
> Thank you, Thank you
> I believe you have solved my problem. I tested your
> routine quick quick in Acad and it indeed returns to
> dimscale needed (except if dimscale = 1, it seems to
> return nil) I don't quite understand this, but I'll try to
> incorporate the routine into the lisp program I've been
> trying to write. I hope its OK to use your routine, and
> share it around the office. I'll let you know if all is
> successful.
> Thanks again
> Cliff
0 Likes
Message 9 of 26

Anonymous
Not applicable
Hello!

I've been interested in this thread and would like to add 2 small changes.

(defun c:test ( / ent applist dimscale dimstyle dimstyledata)
(setq applist nil)
(setq ent (entsel "\nSelect a dimension: "))
(if
(and
ent
(= "DIMENSION" (cdr (assoc 0 (setq ent (entget (car ent) '("ACAD"))))))
)
(if
(and
(setq applist (assoc -3 ent))
(setq applist (assoc 1040 (member '(1070 . 40)(cdadr applist)))) ; changed by JB
)
(setq dimscale (cdr applist))
(progn
(setq dimstyle (cdr (assoc 3 ent)))
(setq dimstyledata (entget (tblobjname "DIMSTYLE" dimstyle )))
(setq dimscale (cdr (assoc 40 dimstyledata)))
(if (not dimscale) (setq dimscale 1)); added by JB
)
)
(progn
(princ "\nPlease try again. ")
(princ)
)
)
)

;;;(1070 . 144) for dimlfac
;;;(1070 . 40) for dimscale
;;;etc.

For the above see the group codes for DIMSTYLE

--
Best regards: Jimmy B
CAD coordinator at Emtunga International AB
www.emtunga.com
Steve Doman skrev i diskussionsgruppsmeddelandet:[email protected]...
> Clifford,
>
> Glad to have helped and please use the code any way you
> wish. It was an interesting problem.
>
> I don't know why the routine returns nill when dimscale
> equal to 1 for I am unable to reproduce that error. I've
> tested the routine on a dimension where the dimscale (equal
> to 1) was controlled by the dimstyle. And I also tested on
> a dimension where the dimcale was controlled by a user
> applied dimoverride, as well as an AutoCAD applied
> dimoverride (per vport where the dimstyle's dimscale is set
> at 0 and the vport vscale is 1).
>
> Perhaps you can send me a small drawing with the problematic
> dimension? If so, please send to the address below.
>
> Thanks,
>
> Steve Doman
> [email protected]
>
>
>
> "Clifford Leblang" wrote:
> > Steve,
> > Thank you, Thank you
> > I believe you have solved my problem. I tested your
> > routine quick quick in Acad and it indeed returns to
> > dimscale needed (except if dimscale = 1, it seems to
> > return nil) I don't quite understand this, but I'll try to
> > incorporate the routine into the lisp program I've been
> > trying to write. I hope its OK to use your routine, and
> > share it around the office. I'll let you know if all is
> > successful.
> > Thanks again
> > Cliff
>
>
>
0 Likes
Message 10 of 26

Anonymous
Not applicable
Jimmy,
Thanks for your interest and help. I gave the routine a quick try, and as
before, acad returns the correct response at the command line, but still
doesn't actually change to dimension variable "dimscale" to match. That's
the part (some of it) that I've been having trouble with. I know it's in
there someplace. I'll add some history >

Lets say I've drawn several layers of a floor plan and different layers will
be
plotted w/ different scales from layout. I use one dimension style, and
let acad automatically scale the dimensions properly from a floating
viewport.
Later, in model space I want to add more dimensions to a given layer (with
its associated dim layer; one for each viewport) and I just want to make
one pick to set my variables and add my new dimensions. I've added in some
lines
from a previous routine to set my layer from a picked object. but none of
that part is working. I'll include a copy of my routine. Perhaps you can
help.
Thanks very much,
Cliff

Jimmy B wrote in message
news:[email protected]...
Hello!

I've been interested in this thread and would like to add 2 small changes.

(defun c:test ( / ent applist dimscale dimstyle dimstyledata)
(setq applist nil)
(setq ent (entsel "\nSelect a dimension: "))
(if
(and
ent
(= "DIMENSION" (cdr (assoc 0 (setq ent (entget (car ent)
'("ACAD"))))))
)
(if
(and
(setq applist (assoc -3 ent))
(setq applist (assoc 1040 (member '(1070 . 40)(cdadr applist)))) ;
changed by JB
)
(setq dimscale (cdr applist))
(progn
(setq dimstyle (cdr (assoc 3 ent)))
(setq dimstyledata (entget (tblobjname "DIMSTYLE" dimstyle )))
(setq dimscale (cdr (assoc 40 dimstyledata)))
(if (not dimscale) (setq dimscale 1)); added by JB
)
)
(progn
(princ "\nPlease try again. ")
(princ)
)
)
)

;;;(1070 . 144) for dimlfac
;;;(1070 . 40) for dimscale
;;;etc.

For the above see the group codes for DIMSTYLE

--
Best regards: Jimmy B
CAD coordinator at Emtunga International AB
www.emtunga.com
Steve Doman skrev i
diskussionsgruppsmeddelandet:[email protected]...
> Clifford,
>
> Glad to have helped and please use the code any way you
> wish. It was an interesting problem.
>
> I don't know why the routine returns nill when dimscale
> equal to 1 for I am unable to reproduce that error. I've
> tested the routine on a dimension where the dimscale (equal
> to 1) was controlled by the dimstyle. And I also tested on
> a dimension where the dimcale was controlled by a user
> applied dimoverride, as well as an AutoCAD applied
> dimoverride (per vport where the dimstyle's dimscale is set
> at 0 and the vport vscale is 1).
>
> Perhaps you can send me a small drawing with the problematic
> dimension? If so, please send to the address below.
>
> Thanks,
>
> Steve Doman
> [email protected]
>
>
>
> "Clifford Leblang" wrote:
> > Steve,
> > Thank you, Thank you
> > I believe you have solved my problem. I tested your
> > routine quick quick in Acad and it indeed returns to
> > dimscale needed (except if dimscale = 1, it seems to
> > return nil) I don't quite understand this, but I'll try to
> > incorporate the routine into the lisp program I've been
> > trying to write. I hope its OK to use your routine, and
> > share it around the office. I'll let you know if all is
> > successful.
> > Thanks again
> > Cliff
>
>
>
0 Likes
Message 11 of 26

Anonymous
Not applicable
Maybee this is what you want?

;sets dimstyle, dimscale and layer associated with the selected dimension
(defun c:gds (/ ent applist dimscale dimstyle dimstyledata)
(setq applist nil)
(setq ent (entsel "\nSelect a dimension: "))
(if
(and
ent
(= "DIMENSION" (cdr (assoc 0 (setq ent (entget (car ent)
'("ACAD"))))))
)
(if
(and
(setq applist (assoc -3 ent))
(setq
applist (assoc 1040 (member '(1070 . 40) (cdadr applist)))
)
)
(setq dimscale (cdr applist))
(progn
(setq dimstyle (cdr (assoc 3 ent)))
(setq dimstyledata (entget (tblobjname "DIMSTYLE" dimstyle)))
(setq dimscale (cdr (assoc 40 dimstyledata)))
(if (not dimscale)
(setq dimscale 1)
)
(setvar "dimscale" dimscale)
(setq 1name (cdr (assoc 8 ent)))
(command "layer" "s" 1name "")
(command "dimstyle" "r" dimstyle)
)
)
(progn
(princ "\nPlease try again. ")
(princ)
)
)
)

--
Best regards: Jimmy B
CAD coordinator at Emtunga International AB
www.emtunga.com
0 Likes
Message 12 of 26

Anonymous
Not applicable
Dear Jimmy,
I don't know, but the same thing is still happening. I pick a dimension,
and the correct dimscale reads out at the command line, but nothing else
happens. The dimvar dimscale is still set to zero, and I'm not on the
picked layer. I just don't get it. I'll attatch the dwg I'm using which is
saved as a rel 14 dwg.
Thanks very much for your help. Maybe we can get it working
Cliff

Jimmy B wrote in message
news:[email protected]...
Maybee this is what you want?

;sets dimstyle, dimscale and layer associated with the selected dimension
(defun c:gds (/ ent applist dimscale dimstyle dimstyledata)
(setq applist nil)
(setq ent (entsel "\nSelect a dimension: "))
(if
(and
ent
(= "DIMENSION" (cdr (assoc 0 (setq ent (entget (car ent)
'("ACAD"))))))
)
(if
(and
(setq applist (assoc -3 ent))
(setq
applist (assoc 1040 (member '(1070 . 40) (cdadr applist)))
)
)
(setq dimscale (cdr applist))
(progn
(setq dimstyle (cdr (assoc 3 ent)))
(setq dimstyledata (entget (tblobjname "DIMSTYLE" dimstyle)))
(setq dimscale (cdr (assoc 40 dimstyledata)))
(if (not dimscale)
(setq dimscale 1)
)
(setvar "dimscale" dimscale)
(setq 1name (cdr (assoc 8 ent)))
(command "layer" "s" 1name "")
(command "dimstyle" "r" dimstyle)
)
)
(progn
(princ "\nPlease try again. ")
(princ)
)
)
)

--
Best regards: Jimmy B
CAD coordinator at Emtunga International AB
www.emtunga.com
0 Likes
Message 13 of 26

Anonymous
Not applicable
Attached is my 2 cents worth. Give it a try and see if it's what your
looking for.

Regards,
Steve Doman

"Clifford Leblang" wrote:
> Dear Jimmy,
> I don't know, but the same thing is still happening. I pick a dimension,
> and the correct dimscale reads out at the command line, but nothing else
> happens. The dimvar dimscale is still set to zero, and I'm not on the
> picked layer. I just don't get it. I'll attatch the dwg I'm using which
is
> saved as a rel 14 dwg.
> Thanks very much for your help. Maybe we can get it working
> Cliff
0 Likes
Message 14 of 26

Anonymous
Not applicable
Thanks Jimmy,

I agree about the extra checking where you have added the MEMBER call. I
came to the same conclusion but happened to use ASSOC. I also added a check
for ACAD xdata, just in case some other application's xdata might be there
(who knows). I'm using R14 by the way.

However, I don't understand your use of setting dimscale to 1. Seems to me
that the picked dimension must have either a dimscale from the dimension
style, or an applied dimoverride dimscale.

From my limited testing, it seems that a dimension's dimscale will be found
either in the dimension's -3 Acad xdata if a dimscale override exists, or it
will default to the dimscale found within the dimension style definition.
From what I can tell, when the user creates a dimstyle with a zero dimscale
("Scale to Paper Space"), AutoCAD automatically applies a dimscale override
per the vport scale. If no vport exist, AutoCAD seems to default to a
dimscale override of 1.

Just my two cents. Thanks.

Regards,
Steve Doman

"Jimmy B" wrote:
> Hello!
>
> I've been interested in this thread and would like
> to add 2 small changes.
>
> (member '(1070 . 40)(cdadr applist)) ; changed by JB
> ...
> (if (not dimscale) (setq dimscale 1)); added by JB
>
0 Likes
Message 15 of 26

Anonymous
Not applicable
Steve,
At last, At last > it works. Obviously, it was quite a bit more complicated
than I first imagined. I'll look thru the code and try to learn just how
you did it. I see that you addressed Jimmy B in the same thread, and that
message helps me to understand a little more. Thanks so much for your help
(to both of you). It's nice to know that you guys are out there. MUCH MUCH
APPRECIATED.
Clifford Leblang
Steve Doman wrote in message
news:[email protected]...
>
> Attached is my 2 cents worth. Give it a try and see if it's what your
> looking for.
>
> Regards,
> Steve Doman
>
>
> "Clifford Leblang" wrote:
> > Dear Jimmy,
> > I don't know, but the same thing is still happening. I pick a
dimension,
> > and the correct dimscale reads out at the command line, but nothing else
> > happens. The dimvar dimscale is still set to zero, and I'm not on the
> > picked layer. I just don't get it. I'll attatch the dwg I'm using which
> is
> > saved as a rel 14 dwg.
> > Thanks very much for your help. Maybe we can get it working
> > Cliff
>
>
>
>
0 Likes
Message 16 of 26

Anonymous
Not applicable
Steve - I use 2000 and the dimensions dimscale doesn't exist when it's set to 1.

--
Best regards: Jimmy B
CAD coordinator at Emtunga International AB
www.emtunga.com
Steve Doman skrev i diskussionsgruppsmeddelandet:[email protected]...
> Thanks Jimmy,
>
> I agree about the extra checking where you have added the MEMBER call. I
> came to the same conclusion but happened to use ASSOC. I also added a check
> for ACAD xdata, just in case some other application's xdata might be there
> (who knows). I'm using R14 by the way.
>
> However, I don't understand your use of setting dimscale to 1. Seems to me
> that the picked dimension must have either a dimscale from the dimension
> style, or an applied dimoverride dimscale.
>
> From my limited testing, it seems that a dimension's dimscale will be found
> either in the dimension's -3 Acad xdata if a dimscale override exists, or it
> will default to the dimscale found within the dimension style definition.
> From what I can tell, when the user creates a dimstyle with a zero dimscale
> ("Scale to Paper Space"), AutoCAD automatically applies a dimscale override
> per the vport scale. If no vport exist, AutoCAD seems to default to a
> dimscale override of 1.
>
>
> Just my two cents. Thanks.
>
> Regards,
> Steve Doman
>
>
> "Jimmy B" wrote:
> > Hello!
> >
> > I've been interested in this thread and would like
> > to add 2 small changes.
> >
> > (member '(1070 . 40)(cdadr applist)) ; changed by JB
> > ...
> > (if (not dimscale) (setq dimscale 1)); added by JB
> >
>
>
>
>
0 Likes
Message 17 of 26

Anonymous
Not applicable
Aha! Could you please show me a screen dump of a R2000 dimension entity
data list? Preferably by opening a new drawing with nothing in it, not even
a paper space vport, and setting up a dimension style to scale by paper
space.

Thanks,
Steve Doman

"Jimmy B" wrote in message
news:[email protected]...
Steve - I use 2000 and the dimensions dimscale doesn't exist when it's set
to 1.

--
Best regards: Jimmy B
CAD coordinator at Emtunga International AB
www.emtunga.com
0 Likes
Message 18 of 26

Anonymous
Not applicable
Glad to have helped. I found it an interesting problem, one which I hope to
incorporate the coding into some other routines.

Regards,
Steve Doman

"Clifford Leblang" wrote in message
news:[email protected]...
> Steve,
> At last, At last > it works. Obviously, it was quite a bit more
complicated
> than I first imagined. I'll look thru the code and try to learn just how
> you did it. I see that you addressed Jimmy B in the same thread, and that
> message helps me to understand a little more. Thanks so much for your
help
> (to both of you). It's nice to know that you guys are out there. MUCH
MUCH
> APPRECIATED.
> Clifford Leblang
0 Likes
Message 19 of 26

Anonymous
Not applicable
Since Jimmy hasn't responded yet, here is a dump of a linear dimension, in
paper space, with a parent style that is a copy of the Standard style, with
the exception of "Scale dimensions to layout (paperspace)" which is set
(DimScale=0).

((-1 . )
(0 . "DIMENSION")
(330 . )
(5 . "5F")
(100 . "AcDbEntity")
(67 . 1)
(410 . "Layout1")
(8 . "0")
(100 . "AcDbDimension")
(2 . "*D2")
(10 3.52668 4.71551 0.0)
(11 4.23168 4.71551 0.0)
(12 0.0 0.0 0.0)
(70 . 32)
(1 . "")
(71 . 5)
(72 . 1)
(41 . 1.0)
(42 . 0.984754)
(52 . 0.0)
(53 . 0.0)
(54 . 0.0)
(51 . 0.0)
(210 0.0 0.0 1.0)
(3 . "Copy of Standard")
(100 . "AcDbAlignedDimension")
(13 2.54193 4.0 0.0)
(14 3.52668 4.0 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.0)
(1002 . "}")
)
)
)

Here is the same type of dim within a viewport. Doesn't look weird to me.

((-1 . )
(0 . "DIMENSION")
(330 . )
(5 . "6F")
(100 . "AcDbEntity")
(67 . 0)
(410 . "Model")
(8 . "0")
(100 . "AcDbDimension")
(2 . "*D3")
(10 10.2381 10.8514 0.0)
(11 19.5981 10.8514 0.0)
(12 0.0 0.0 0.0)
(70 . 32)
(1 . "")
(71 . 5)
(72 . 1)
(41 . 1.0)
(42 . 13.7737)
(52 . 0.0)
(53 . 0.0)
(54 . 0.0)
(51 . 0.0)
(210 0.0 0.0 1.0)
(3 . "Copy of Standard")
(100 . "AcDbAlignedDimension")
(13 -3.53564 2.38287 0.0)
(14 10.2381 2.38287 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 . 12.0)
(1002 . "}"
)
)
)
)

--
R. Robert Bell, MCSE
Network Administrator (or, Modern-day Wizard)
(remove the "not." in my address for direct e-mail)
0 Likes
Message 20 of 26

Anonymous
Not applicable
Thanks Robert. Looks like there isn't a difference in the dimoverride data
between R14 and R15.

However!

This GDS routine is still not right. After actually using the program in
the real world situations, I discover my logic to getting the dimscale is
all garbage because the xdata can have more then one 1040 list! Apparently
I need to get the 1040 list that follows a '(1070 . 40). Anyone have any
ideas on how to do this?

Dimscale dimoverride:
(-3
("ACAD"
(1000 . "DSTYLE")
(1002 . "{")
(1070 . 40) <--- dimscale
(1040 . 4.0)
(1002 . "}")
)
)

Dimexo dimoverride:
(-3
("ACAD"
(1000 . "DSTYLE")
(1002 . "{")
(1070 . 42)
(1040 . 0.125) <--- dimexo
(1002 . "}")
)
)

Both dimscale and dimexo overrides:
(-3
("ACAD"
(1000 . "DSTYLE")
(1002 . "{")
(1070 . 40) <--- dimscale
(1040 . 4.0)
(1070 . 42)
(1040 . 0.125) <--- dimexo
(1002 . "}")
)
)

Thanks,
Steve Doman

R. Robert Bell wrote in message
news:[email protected]...
> Since Jimmy hasn't responded yet, here is a dump of a linear dimension, in
> paper space, with a parent style that is a copy of the Standard style,
with
> the exception of "Scale dimensions to layout (paperspace)" which is set
> (DimScale=0).
>
> ((-1 . )
> (0 . "DIMENSION")
> (330 . )
> (5 . "5F")
> (100 . "AcDbEntity")
> (67 . 1)
> (410 . "Layout1")
> (8 . "0")
> (100 . "AcDbDimension")
> (2 . "*D2")
> (10 3.52668 4.71551 0.0)
> (11 4.23168 4.71551 0.0)
> (12 0.0 0.0 0.0)
> (70 . 32)
> (1 . "")
> (71 . 5)
> (72 . 1)
> (41 . 1.0)
> (42 . 0.984754)
> (52 . 0.0)
> (53 . 0.0)
> (54 . 0.0)
> (51 . 0.0)
> (210 0.0 0.0 1.0)
> (3 . "Copy of Standard")
> (100 . "AcDbAlignedDimension")
> (13 2.54193 4.0 0.0)
> (14 3.52668 4.0 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.0)
> (1002 . "}")
> )
> )
> )
>
> Here is the same type of dim within a viewport. Doesn't look weird to me.
>
> ((-1 . )
> (0 . "DIMENSION")
> (330 . )
> (5 . "6F")
> (100 . "AcDbEntity")
> (67 . 0)
> (410 . "Model")
> (8 . "0")
> (100 . "AcDbDimension")
> (2 . "*D3")
> (10 10.2381 10.8514 0.0)
> (11 19.5981 10.8514 0.0)
> (12 0.0 0.0 0.0)
> (70 . 32)
> (1 . "")
> (71 . 5)
> (72 . 1)
> (41 . 1.0)
> (42 . 13.7737)
> (52 . 0.0)
> (53 . 0.0)
> (54 . 0.0)
> (51 . 0.0)
> (210 0.0 0.0 1.0)
> (3 . "Copy of Standard")
> (100 . "AcDbAlignedDimension")
> (13 -3.53564 2.38287 0.0)
> (14 10.2381 2.38287 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 . 12.0)
> (1002 . "}"
> )
> )
> )
> )
>
> --
> R. Robert Bell, MCSE
> Network Administrator (or, Modern-day Wizard)
> (remove the "not." in my address for direct e-mail)
>
>
>
0 Likes