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

Linear dimension using two work points

ysbaodnj
Enthusiast

Linear dimension using two work points

ysbaodnj
Enthusiast
Enthusiast

We want to represent a dimension using two points.
However, if two points are not collinear, as shown below, the dimensions are displayed diagonally.

사진1.PNG

Is it possible to make these two points appear unconditionally in linear dimensions as shown in the picture below?

사진2.PNG

 

0 Likes
Reply
Accepted solutions (1)
471 Views
4 Replies
Replies (4)

JMGunnar
Collaborator
Collaborator
Accepted solution

You can use   

DimensionTypeEnum.kHorizontalDimensionType
	Dim linDimA1 = genDims.AddLinear("DimensionA1", DimPos, StartBottomPoint, EndBottomPoint,DimensionTypeEnum.kHorizontalDimensionType,dimensionStyle := ds)

Best Regards Johan Gunnar

 

0 Likes

JMGunnar
Collaborator
Collaborator
	Class ThisRule	
		
		''SetDimensionPositions("view")
		Dim viewCenter As Point2d	
		Dim leftView As Double 
		Dim rightView As Double
		Dim belowView As Double
		Dim overView As Double
		Dim viewCenterX As Double
		Dim viewCenterY As Double
		Dim currentDim As GeneralDimension	
		
		Sub Main()	
			
			Dim ds As DimensionStyle = ThisDrawing.Document.StylesManager.DimensionStyles.Item(oDimensionStyles)
			Dim genDims =  ActiveSheet.DrawingDimensions.GeneralDimensions
	
					
			''''Sheet 1
			 	ActiveSheet = ThisDrawing.Sheet("Sheet:2")
			'''Dimension View A
				Dim view_A = ActiveSheet.DrawingViews.ItemByName("A")
				
				oView = ActiveSheet.View("A").View
				
			'''Get Position of View	
				SetDimensionPositions("A")
					
				
				LeftPoint = view_A.GetIntent({"MasterTank" }, "LeftPoint")
				RightPoint = view_A.GetIntent({"MasterTank" }, "RightPoint")
				
				''Set Dimension 
					DimPos = ThisDrawing.Geometry.Point2d(0, belowView-10)
				Dim linDimA1 = genDims.AddLinear("DimensionA1", DimPos, LeftPoint, EndBottomPoint,RightPoint.kHorizontalDimensionType,dimensionStyle := ds)
		
		End Sub 
	
	
	
		Sub SetDimensionPositions(viewName As String)
			viewCenter = ActiveSheet.View(viewName).View.Center
			leftView = viewCenter.X*10 - ActiveSheet.View(viewName).Width / 2
			rightView = viewCenter.X*10 + ActiveSheet.View(viewName).Width / 2
			belowView = viewCenter.Y*10 - ActiveSheet.View(viewName).Height / 2
			overView = viewCenter.Y * 10 + ActiveSheet.View(viewName).Height / 2
			viewCenterX = viewCenter.X * 10
			viewCenterY = viewCenter.Y * 10
		End Sub
	
	End Class
	
0 Likes

ysbaodnj
Enthusiast
Enthusiast
Thank you for answer! Problem solved 🙂
0 Likes

JMGunnar
Collaborator
Collaborator

Please use Accepted Solutions

then we can see if the problem is solve in the future 

 

@ysbaodnj 

 

see info 

https://forums.autodesk.com/t5/forum-user-guides/accepted-solutions-what-they-are-how-to-find-them-a...

 

Best Regards Johan

0 Likes