DRAWING SHEET iLogic - Ordinate Dimension overides

DRAWING SHEET iLogic - Ordinate Dimension overides

Anonymous
Not applicable
680 Views
4 Replies
Message 1 of 5

DRAWING SHEET iLogic - Ordinate Dimension overides

Anonymous
Not applicable

Hi,

I would like to be able to select an ordinate dimension set and over ride the first dimension in the set 

1. Select a dimension set

2. set  Dimension Appearance to Basic

3. Hide dimension value (which is 0)

4. add Text '01'

5. Have three button options for the text '01' '02' '03'

 

I am a newb to ilogic so any help would be greatly appreciated

Ordinate Dims.JPG

0 Likes
Accepted solutions (1)
681 Views
4 Replies
Replies (4)
Message 2 of 5

chandra.shekar.g
Autodesk Support
Autodesk Support

@Anonymous,

 

Try the below iLogic code to select number and rename ordinate dimension.

 

Sub Main() 

	Dim oDimension As DrawingDimension
	oDimension = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingDimensionFilter, "Pick a Ordinate dimension to rename")
	    
	If oDimension.Type = ObjectTypeEnum.kOrdinateDimensionObject Then
		
		Dim oList As ArrayList = New ArrayList()
		oList.Add("01")
		oList.Add("02")
		oList.Add("03")
		 
		selected_num = InputListBox("Choose number to rename", oList, oList.Item(0), "Numbers list", "List of numbers to rename ordinate dimension")
		
		oDimension.HideValue = True 
		
		Select Case selected_num 
		
		Case "01" 
			
			oDimension.Text.FormattedText = "01"
		Case "02" 
			
			oDimension.Text.FormattedText = "02"
		Case "03"
			
			oDimension.Text.FormattedText = "03"	 
		End Select  
	Else
	    MsgBox ("Selected drawing dimension is not ordinate dimension")
	    Exit Sub
	End If

End Sub

Please feel free to contact if there is any queries.

 

If solves problem, click on "Accept as solution" / give a "Like".

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 3 of 5

Anonymous
Not applicable

Hi, Thanks so much for your help. The code works fine. I was however hoping to change the appearance of the first dimension so that it appears as 'Basic' in the 'Precision and Tolerance' tab in the dimension editor.  See attached picture.

 

Thanks again

 

Peter

Basic tolerance.JPG

0 Likes
Message 4 of 5

chandra.shekar.g
Autodesk Support
Autodesk Support
Accepted solution

@Anonymous,

 

Try below iLogic code to convert tolerance type to basic.

 

Sub Main() 

	Dim oDimension As DrawingDimension
	oDimension = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingDimensionFilter, "Pick a Ordinate dimension to rename")
	    
	If oDimension.Type = ObjectTypeEnum.kOrdinateDimensionObject Then
		
		Dim oList As ArrayList = New ArrayList()
		oList.Add("01")
		oList.Add("02")
		oList.Add("03")
		 
		selected_num = InputListBox("Choose number to rename", oList, oList.Item(0), "Numbers list", "List of numbers to rename ordinate dimension")
		
		oDimension.HideValue = True 
		
		Select Case selected_num 
		
		Case "01" 
			
			oDimension.Text.FormattedText = "01"
			
		Case "02" 
			
			oDimension.Text.FormattedText = "02"
		Case "03"
			
			oDimension.Text.FormattedText = "03"	 
		End Select 
		
		Call oDimension.Tolerance.SetToBasic()
	Else
	    MsgBox ("Selected drawing dimension is not ordinate dimension")
	    Exit Sub
	End If

End Sub

Please feel free to contact if there is any queries.

 

If solves problem, click on "Accept as solution" / give a "Like".

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 5 of 5

Anonymous
Not applicable

Wow thanks This is great

0 Likes