Get Dimension Value of Dimension that isnt attached to a model. (In Drawing)

Get Dimension Value of Dimension that isnt attached to a model. (In Drawing)

C_Haines_ENG
Collaborator Collaborator
373 Views
3 Replies
Message 1 of 4

Get Dimension Value of Dimension that isnt attached to a model. (In Drawing)

C_Haines_ENG
Collaborator
Collaborator

 

Hello again,

 

I previously had gotten a peice of code which worked very well for a long time, but Im starting to run into problems with it.

 

I've created a script that gets the biggest values of all the dimensions on a page for a list of overall dimensions, but sometimes I will attach the biggest dimension to sketch lines that are attached to the model, however upon calling this:

 

For Each oDim As DrawingDimension In oSheet.DrawingDimensions
	Dim DimValue = Round(oDim.ModelValue, 3) * 10 

It wont return the value of any dimensions that arent explicitly attached to a model for obvious reasons (ModelValue). Is there a way to retreieve value of the dimension, regardless of if its attached to a model or not? 

 

EDIT:

NEVERMIND IM DUMB, Was something else wrong with my 700 line code that I didnt think to check first. It is getting the dimension value.

Thanks.

0 Likes
Accepted solutions (1)
374 Views
3 Replies
Replies (3)
Message 2 of 4

C_Haines_ENG
Collaborator
Collaborator
Accepted solution

Wow he solved it nothing was wrong!

Message 3 of 4

WCrihfield
Mentor
Mentor

Edit:  Posted before seeing above response.

It should return a value, if one is available, because the online help documentation for the DrawingDimension.ModelValue says that it will return the value "as defined in the model or as measured in the drawing".  However, the DrawingDimension also has a HideValue property that can be set to True, and does have the ability to override the value (DrawingDimension_ModelValueOverriddenDrawingDimension.OverrideModelValue).  If you check what more specific 'type' of dimension it is, sometimes you can get the DimensionLine (generic Object type value), then use that to get a 'scaled' value, then multiply/divide by the scale of the view to get the real value.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 4 of 4

C_Haines_ENG
Collaborator
Collaborator

I always appreciate the help, even if I didnt need it 😂

0 Likes