Move 3D Dimension Text After Placement

Move 3D Dimension Text After Placement

Anonymous
Not applicable
573 Views
3 Replies
Message 1 of 4

Move 3D Dimension Text After Placement

Anonymous
Not applicable

Can the text placement of a radius or diameter 3D dimension be changed after it has been placed?

I can get the coordinates of a given dimension's text easy enough, but can't figure out how to reposition it.

I tried changing the TextPosition.(XYZ) properties directly, or using the PutPointData method, but the dimension remains unchanged.

 

And maybe the question I should be asking is:

Is there a way to place leader based 3D dimensions that prevents them from flying off into the void as a part updates due to parameter changes?

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

Anonymous
Not applicable

Following up:

 

I had thought that it might be easier to use an errant dimension's properties to create a clone in the desired place. However, this leads me to a new question. Is there a way to fetch the geometry intent of a 3D dimension that references a single edge or curve?

 

I'm diving into reference keys in an effort to learn how to dimension a part via code, but that is a lot of heavy lifting compared to updating predefined named dimensions.

0 Likes
Message 3 of 4

JelteDeJong
Mentor
Mentor
Accepted solution

im not enterly sure what you want to do. if i try to move a 3d diameter dimension with the following code it moves. The only thing is that it only moves over the plane that is created when the dimension was created.

Dim doc As PartDocument = ThisApplication.ActiveDocument
Dim oTg = ThisApplication.TransientGeometry
Dim dim3d As DiameterModelDimension = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kModelAnnotationFilter, "select a DiameterModelDimension")

Dim dim3dDefinition As DiameterModelDimensionDefinition = dim3d.Definition
Dim landingPosition As Point = dim3dDefinition.LandingPosition
Dim newTextPoint As Point = otg.CreatePoint(landingPosition.X + 1, landingPosition.Y + 1, landingPosition.Z + 1)

dim3dDefinition.LandingPosition = newTextPoint

this code will only work for diameter dimensions. for radius dimensions you should the interface RadiusModelDimension(Definition) instead of DiameterModelDimension(Definition)

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

Message 4 of 4

Anonymous
Not applicable

Thank you,  hjalte79. That is exactly what I was after; and it makes arraying 3D dimensions
a snap by picking the first one and applying the offset to its neighbor.

 

I'd failed to drill down and create a variable of "xxModelDimensionDefinition" type, but was
futzing around with "oDef.ModelAnnotations.ModelDimensions.Item("xx").Definition.TextPosition" instead.

0 Likes