Dimension parent vs. child
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
Dimension parent vs. child

 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA
Author Message
Eddy
Guest





Posted: Fri Dec 10, 2004 11:04 am    Post subject: Dimension parent vs. child Reply with quote

Ok.
So, I'm a little fluent with VBA and I can create a dimension string.
However, I want to define a child to that dimension and alter one variable
for that child. I can reset the variable, but it becomes an override and
not the child I'm after. My goal is to be able to draw the leaders I want
but still be able to have the dimensions.

Is there an easy way to make a child object from an altered parent dimension
string?

thanks in advance.
Eddy Krygiel

Back to top
rwilkins
Guest





Posted: Sat Dec 11, 2004 12:40 am    Post subject: Re: Dimension parent vs. child Reply with quote

To create a child dimension, take the parent dimension name and add a dollar sign ($) followed by a number:

$0 = Linear Dimensions
$2 = Angular Dimensions
$4 = Radial Dimensions
$3 = Diameter Dimensions
$6 = Ordinate Dimensions
$7 = Leaders

So if the only dimension style you have in the drawing is Standard:

Dim DS as AcadDimStyle
Set DS = Thisdrawing.DimStyles.add("Standard$7")
DS.CopyFrom ThisDrawing.Database

The CopyFrom method takes dimoverrides from the drawing and saves them to the child dimstyle.
Back to top
Eddy
Guest





Posted: Sun Dec 12, 2004 1:24 am    Post subject: Re: Dimension parent vs. child Reply with quote

First, thanks for the help. I think I got part of it covered. I can create
child dimstyles with different variables than the parent.

My one other issue though is my dimstyle is a moving target. My routine
name the dimstyle based on the current dimscale. So, if my dimscale is 1,
my dimstyle is 1. When I go to name the child of the dimstyle, I have to
call it specifically. eg:
Set Bdim = ThisDrawing.DimStyles.Add("1$7")
Where Bdim is my new dimstyle. Previously, I have been creating them like
this:
Scalefactor = ActiveDocument.GetVariable("dimscale")
Set Bdim = ThisDrawing.DimStyles.Add(Scalefactor)

How can I set the child to be a factor of the dimscale? When I try to enter
scalefactor$7 or scalefactor"$7" or something to that effect, it either
errors out or I get a dimstyle named "scalefactor$7".

thoughts?
thanks for everything so far.

eddy

"rwilkins" <nospam@address.withheld> wrote in message
news:306534.1102707666423.JavaMail.jive@jiveforum1.autodesk.com...
Quote:
To create a child dimension, take the parent dimension name and add a
dollar sign ($) followed by a number:

$0 = Linear Dimensions
$2 = Angular Dimensions
$4 = Radial Dimensions
$3 = Diameter Dimensions
$6 = Ordinate Dimensions
$7 = Leaders

So if the only dimension style you have in the drawing is Standard:

Dim DS as AcadDimStyle
Set DS = Thisdrawing.DimStyles.add("Standard$7")
DS.CopyFrom ThisDrawing.Database

The CopyFrom method takes dimoverrides from the drawing and saves them to
the child dimstyle.


Back to top
Jeff Mishler
Guest





Posted: Sun Dec 12, 2004 1:37 am    Post subject: Re: Dimension parent vs. child Reply with quote

Scalefactor=Scalefactor & "$7
Set Bdim = ThisDrawing.DimStyles.Add(Scalefactor)

--
Jeff
check out www.cadvault.com
"Eddy" <ekrygiel@treanorarchitects.com> wrote in message
news:41bb5793$1_1@newsprd01...
Quote:
First, thanks for the help. I think I got part of it covered. I can
create child dimstyles with different variables than the parent.

My one other issue though is my dimstyle is a moving target. My routine
name the dimstyle based on the current dimscale. So, if my dimscale is 1,
my dimstyle is 1. When I go to name the child of the dimstyle, I have to
call it specifically. eg:
Set Bdim = ThisDrawing.DimStyles.Add("1$7")
Where Bdim is my new dimstyle. Previously, I have been creating them like
this:
Scalefactor = ActiveDocument.GetVariable("dimscale")
Set Bdim = ThisDrawing.DimStyles.Add(Scalefactor)

How can I set the child to be a factor of the dimscale? When I try to
enter scalefactor$7 or scalefactor"$7" or something to that effect, it
either errors out or I get a dimstyle named "scalefactor$7".

thoughts?
thanks for everything so far.

eddy

"rwilkins" <nospam@address.withheld> wrote in message
news:306534.1102707666423.JavaMail.jive@jiveforum1.autodesk.com...
To create a child dimension, take the parent dimension name and add a
dollar sign ($) followed by a number:

$0 = Linear Dimensions
$2 = Angular Dimensions
$4 = Radial Dimensions
$3 = Diameter Dimensions
$6 = Ordinate Dimensions
$7 = Leaders

So if the only dimension style you have in the drawing is Standard:

Dim DS as AcadDimStyle
Set DS = Thisdrawing.DimStyles.add("Standard$7")
DS.CopyFrom ThisDrawing.Database

The CopyFrom method takes dimoverrides from the drawing and saves them to
the child dimstyle.

Back to top
Eddy
Guest





Posted: Sun Dec 12, 2004 3:56 am    Post subject: Re: Dimension parent vs. child Reply with quote

thanks!!
that did the trick.

"Jeff Mishler" <jeff_m@cadvault.com> wrote in message
news:41bb5a89_3@newsprd01...
Quote:
Scalefactor=Scalefactor & "$7
Set Bdim = ThisDrawing.DimStyles.Add(Scalefactor)

--
Jeff
check out www.cadvault.com
"Eddy" <ekrygiel@treanorarchitects.com> wrote in message
news:41bb5793$1_1@newsprd01...
First, thanks for the help. I think I got part of it covered. I can
create child dimstyles with different variables than the parent.

My one other issue though is my dimstyle is a moving target. My routine
name the dimstyle based on the current dimscale. So, if my dimscale is
1, my dimstyle is 1. When I go to name the child of the dimstyle, I have
to call it specifically. eg:
Set Bdim = ThisDrawing.DimStyles.Add("1$7")
Where Bdim is my new dimstyle. Previously, I have been creating them
like this:
Scalefactor = ActiveDocument.GetVariable("dimscale")
Set Bdim = ThisDrawing.DimStyles.Add(Scalefactor)

How can I set the child to be a factor of the dimscale? When I try to
enter scalefactor$7 or scalefactor"$7" or something to that effect, it
either errors out or I get a dimstyle named "scalefactor$7".

thoughts?
thanks for everything so far.

eddy

"rwilkins" <nospam@address.withheld> wrote in message
news:306534.1102707666423.JavaMail.jive@jiveforum1.autodesk.com...
To create a child dimension, take the parent dimension name and add a
dollar sign ($) followed by a number:

$0 = Linear Dimensions
$2 = Angular Dimensions
$4 = Radial Dimensions
$3 = Diameter Dimensions
$6 = Ordinate Dimensions
$7 = Leaders

So if the only dimension style you have in the drawing is Standard:

Dim DS as AcadDimStyle
Set DS = Thisdrawing.DimStyles.add("Standard$7")
DS.CopyFrom ThisDrawing.Database

The CopyFrom method takes dimoverrides from the drawing and saves them
to the child dimstyle.



Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Powered by phpBB