iLogic to move a dimension

iLogic to move a dimension

relicseekerharry
Advocate Advocate
427 Views
3 Replies
Message 1 of 4

iLogic to move a dimension

relicseekerharry
Advocate
Advocate

Hello Forum,

 

I have been working on drawing automation and can't figure out how to make a dimension move from between the centrelines. I have a rule that adds the some dimensions as IManagedLinearGeneralDimensions like this abstraction:

motorDia = genDims.AddLinear("MotorDia", shaftView.SheetPoint(-0.25, 1.4), shaftBottom, shaftTop)

If someFlag Then
     motorDia.NativeEntity.Style = newStyle
End If

motorDia.NativeEntity.Text.FormattedText = "Ø <DimensionValue/>"
	
keyToCtr = genDims.AddLinear("keyToCtr", shaftView.SheetPoint(-0.2, 0.75), keyTop, midplane)



After running my rule:

relicseekerharry_0-1768562773239.png

Desired effect:

relicseekerharry_1-1768562798774.png

 

What is the iLogic required to make the dimension appear like that, given that the formatted text must be edited, and the dimension's style could be changed (to also giving the inch measurements on top of mm) given some flag's state?

 

The desired effect above could be called a "translation right". There is also the case that a "translation left" needs to be made. Will the code to do this differ in an unexpected way?

 

Thank you!

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

dalton_northwind
Enthusiast
Enthusiast
Accepted solution
Message 3 of 4

relicseekerharry
Advocate
Advocate

Thank you for this - it looks very promising. Looks like I'll need to set up the dimension positions in terms of distance from the intent (as this is for a configurator, with varying component positions) to make sure this approach is consistent for me

Message 4 of 4

relicseekerharry
Advocate
Advocate
Accepted solution

The solution to my problem has been found! The behaviour

ThisServer.DrawingOptions.CenterDimensionText

 Was making my dimensions automatically centred when creating them, so the specified point for the dim was being ignored. Using the linked try/finally block as a reference, I toggled automatic centring for those dimensions to get my desired result.

0 Likes