Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Anonymous
1114 Views, 4 Replies

Ilogic move drawingdimensions

Hi, 

 

I am trying to move some drawingdimensions with ilogic, but it is not working. 

with the help of the VBA tool i could find the coordinates of the dimensionlines, but it looks they are read-only. 

Why are these dimensions read only, and can't be moved with ilogic?

for my code i have a simple drawing that has 4 dimensions on it. 

 

Dim osheet As Sheet = ThisApplication.ActiveDocument.activesheet
Dim oview As DrawingView = osheet.DrawingViews(1)
Dim dimension As GeneralDimension

For Each dimension In osheet.DrawingDimensions
	Trace.WriteLine(dimension.ModelValue)
	
	If dimension.DimensionLine.direction.y = 1 Then
		Trace.WriteLine("Direction y=1")
		dimension.DimensionLine.MidPoint.X = oview.Center.X - (oview.Width * 0.5) - 0.6
	ElseIf dimension.DimensionLine.direction.y = -1 Then
		Trace.WriteLine("Direction y=-1")
		dimension.DimensionLine.MidPoint.X = oview.Center.X + (oview.Width * 0.5) + 0.6
	ElseIf dimension.DimensionLine.direction.x = 1 Then
		Trace.WriteLine("Direction x=1")
		dimension.DimensionLine.MidPoint.Y = oview.Center.Y - (oview.Height * 0.5) -0.6
	ElseIf dimension.DimensionLine.direction.x = -1 Then
		Trace.WriteLine("Direction x=-1")
		dimension.DimensionLine.MidPoint.Y = oview.Center.Y + (oview.Height * 0.5) + 0.6
	End If
	
Next
Trace.WriteLine("rule done")

i also tried to create a point2D and then move the MidPoint of the dimensionline to the point. but that also doesn't work

 

I am able to read out all the values of the dimensionline, so ilogic can find the correct properties.

Trace.WriteLine(dimension.DimensionLine.MidPoint.X & " " & dimension.DimensionLine.MidPoint.Y)

Kind regards,

 

Geert