Editing Inventor View Annotations Using iLogic

Editing Inventor View Annotations Using iLogic

Anonymous
Not applicable
1,608 Views
8 Replies
Message 1 of 9

Editing Inventor View Annotations Using iLogic

Anonymous
Not applicable

Hello All,

 

This is frustrating me to no end.

 

Is there any further API in iLogic that allows you to edit the Inventor View Annotations?

The only code I've found so far is DisplayDefinitionBase As Boolean

 

In Particular I am trying to search all view annotation text & then be able to add custom text to it via iLogic code.

View Annotation Text.JPG

Any help would be much appreciated

 

Kind Regards

 

Tim

0 Likes
1,609 Views
8 Replies
Replies (8)
Message 2 of 9

BrandonBG
Collaborator
Collaborator

I think you're looking for the DrawingViewLabel object.

 

Sheet - > DrawingView -> DrawingViewLabel -> Text (as string)

 

If you can provide more detail about what you need to accomplish, someone here will probably provide some code to get started.

 

Brandon

0 Likes
Message 3 of 9

Anonymous
Not applicable

Thanks for your reply Brandon

 

Yeah at first I thought that was it but then quickly realized that interacts with the actual section/detail view label not the section/detail view annotation symbol/text.

 

To further clarify what I am trying to accomplish is basically a simplified version of the app "View Reference" created by CAD Apps Plus on the Autodesk App store (app doesn't support Inventor 2017 yet Smiley Sad)

 

So when I move a section or detail to another sheet in my idw I would like my section/detail view annotation text to reflect sheet number of child view.

 

Inventor Parent Index.pngiLogic Child Index.png

Hope this clarifies it enough.

 

Thanks for your help in advance Smiley Happy

 

Tim

 

 

0 Likes
Message 4 of 9

BrandonBG
Collaborator
Collaborator

I'm going to throw some stuff at you that may or may not help!

 

https://forums.autodesk.com/t5/inventor-customization/default-view-label-characters/m-p/5930091#M601...

 

https://forums.autodesk.com/t5/inventor-customization/max-point-of-section-line/m-p/6024011#M61451

 

Here's my iLogic code that relabels all drawing views A B C D then replaces the drawing view label with a custom sketch symbol. It's not linked, so you have to re-run the rules to get the labels to change. Thanks to MechMachineMan for his help.

 

Brandon

 

Sub Main()

Dim oDrawing As DrawingDocument
oDrawing = ThisApplication.ActiveDocument

Dim oSheets As Sheets
oSheets = oDrawing.Sheets

Dim iSheetCount As Integer
iSheetCount = oSheets.Count

Dim oSheet As Sheet
Dim oPreviousSheet As Sheet
Dim oView As DrawingView
Dim oViews As DrawingViews
Dim oPreviousViews As DrawingViews
Dim oViewSheet As Sheet
Dim oParentView As DrawingView
Dim oParentViewSheet As Sheet
Dim oParentViewSheetName As String
Dim oViewSheetName As String

Dim oParentColonIndex As Integer
Dim oViewColonIndex As Integer
Dim oParentViewSheetNameLength As Integer
Dim oViewSheetNameLength As Integer
Dim oParentViewSheetIndex As String
Dim oViewSheetIndex As String

Dim oSketchSym As SketchedSymbol
Dim oSketchSymLib As SketchedSymbolDefinitionLibrary
oSketchSymLib = oDrawing.SketchedSymbolDefinitions.SketchedSymbolDefinitionLibraries.Item("Library")
Dim oCallOut As SketchedSymbolDefinition
oCallOut = oDrawing.SketchedSymbolDefinitions.AddFromLibrary(oSketchSymLib, "CallOut", True)
Dim oCallOutArrow As SketchedSymbolDefinition
oCallOutArrow = oDrawing.SketchedSymbolDefinitions.AddFromLibrary(oSketchSymLib, "CallOutArrow", True)
Dim oViewLabel As SketchedSymbolDefinition
oViewLabel = oDrawing.SketchedSymbolDefinitions.AddFromLibrary(oSketchSymLib, "ViewLabel", True)

Dim oTransGeom As TransientGeometry
oTransGeom = ThisApplication.TransientGeometry

sViewLabels = New String(){"A","B","C","D","E","F","G","H","J","K","L","M","N","P","R","T","U","V","W","X","Y","Z","AA","AB","AC","AD","AE","AF","AG","AH","AJ","AK","AL","AM","AN","AP","AR","AT","AU","AV","AW","AX","AY","AZ"}
Dim iViewCount = 0

Dim oDrawingIProps As PropertySets
oDrawingIProps = oDrawing.PropertySets
Dim oDrawingCustomIProps As PropertySet 'point to Custom iProperties'
oDrawingCustomIProps = oDrawingIProps.Item("Inventor User Defined Properties")

Dim oPosition As Point2d
Dim oRotation As Double
Dim oViewLabelPosition As Point2d
Dim oOffsetFromBaseView As Double

Dim sPromptFieldsCallOut(1) As String
Dim sPromptFieldsViewLabel(3) As String

iLogicVb.RunExternalRule("dwgRenumberSheets") 'confirms that the iProperties for the page numbers are created

For i = 1 to iSheetCount
	oSheet = oSheets.Item(i)
	'deletes existing call outs since we can't update them
	For Each oSketchSym In oSheet.SketchedSymbols
		Select Case oSketchSym.Name
		Case "CallOut"
			oSketchSym.Delete
		Case "CallOutArrow"
			oSketchSym.Delete
		Case "ViewLabel"
			oSketchSym.Delete
		End Select
	Next 'next sketched symbol'
Next

'assuming there are no drawing views on sheet 1
For i = 2 To iSheetCount
	oSheet = oSheets.Item(i)
	'MessageBox.Show(i,"Sheet")
	
	oPreviousSheet = oSheets.Item(i-1)

	Try 'catches errors if there are no views on a sheet 
		oViews = oSheet.DrawingViews
		oPreviousViews = oPreviousSheet.DrawingViews
		oViews.Item(1).ShowLabel = False 'turns OFF the label for the first view
	Catch 
	End Try

	If oViews.Count() <> 0 And oPreviousViews.Count() <> 0 Then
		If oViews.Item(1).ReferencedDocumentDescriptor.DisplayName <> oPreviousViews.Item(1).ReferencedDocumentDescriptor.DisplayName  Then
			iViewCount = 0
				For Each oView In oViews
					oView.Name = sViewLabels(iViewCount)
					iViewCount = iViewCount + 1
				Next
		ElseIf oViews.Item(1).ReferencedDocumentDescriptor.DisplayName = oPreviousViews.Item(1).ReferencedDocumentDescriptor.DisplayName  Then
				For Each oView In oViews
					oView.Name = sViewLabels(iViewCount)
					iViewCount = iViewCount + 1
				Next
		End If
	ElseIf oViews.Count() <> 0 And oPreviousViews.Count() = 0 Then
		iViewCount = 0
			For Each oView In oViews
				oView.Name = sViewLabels(iViewCount)
				iViewCount = iViewCount + 1
			Next
	ElseIf oViews.Count() = 0 Then
	End If

	Try '9/1/2016
	For Each oView in oSheet.DrawingViews
		oViewSheet = oView.Parent
		oParentView = oView.ParentView

		If (oView.ViewType = 10501 And oParentView Is Nothing) Or (oView Is oViewSheet.DrawingViews.Item(1)) Then 'kStandardDrawingViewType'
			sPromptFieldsViewLabel(0) = oView.Name
			sPromptFieldsViewLabel(1) = oView.ReferencedDocumentDescriptor.ReferencedDocument.PropertySets.Item("Design Tracking Properties").Item("Stock Number").Value & " " & oView.ReferencedDocumentDescriptor.ReferencedDocument.PropertySets.Item("Design Tracking Properties").Item("Description").Value
			sPromptFieldsViewLabel(2) = "SCALE " & oView.ScaleString
			sPromptFieldsViewLabel(3) = ""

			oOffsetFromBaseView = 2.5 'arbitrary distance'
			oViewLabelPosition = oTransGeom.CreatePoint2d(oView.Position.X, oView.Position.Y - (oView.Height/2) - oOffsetFromBaseView)
			oSketchSym = oViewSheet.SketchedSymbols.Add(oViewLabel, oViewLabelPosition, 0, 1, sPromptFieldsViewLabel)
		End If

 		If oParentView IsNot Nothing Then
 			oParentViewSheet = oParentView.Parent
			oParentViewSheetName = oParentViewSheet.Name
			oViewSheetName = oViewSheet.Name
			
			oParentColonIndex = oParentViewSheetName.IndexOf(":")
			oViewColonIndex = oViewSheetName.IndexOf(":")
			
			oParentViewSheetNameLength = Len(oParentViewSheetName)
			oViewSheetNameLength = Len(oParentViewSheetName)
			
			oParentViewSheetIndex = Right(oParentViewSheetName, oParentViewSheetNameLength - oParentColonIndex - 1)
			oViewSheetIndex = Right(oViewSheetName, oViewSheetNameLength - oViewColonIndex - 1)

			Dim sPropName As String
			sPropName = "SheetNumber" & oParentViewSheetIndex

			'oView.ShowLabel = True 'turns on view label for child view on other sheet
			
			Dim oViewType As String
			Select Case oView.ViewType
				Case 10502
				oViewType = "DETAIL "
				Case 10503
				oViewType = "SECTION "
				Case Else
				oViewType = "VIEW "
			End Select
		
			oView.ShowLabel = False

			If oView.Parent IsNot oParentView.Parent Or oViewType <> "VIEW " Then
				sPromptFieldsViewLabel(0) = oView.Name
				sPromptFieldsViewLabel(1) = oView.ReferencedDocumentDescriptor.ReferencedDocument.PropertySets.Item("Design Tracking Properties").Item("Stock Number").Value & " " & oView.ReferencedDocumentDescriptor.ReferencedDocument.PropertySets.Item("Design Tracking Properties").Item("Description").Value
				sPromptFieldsViewLabel(2) = "SCALE " & oView.ScaleString
				sPromptFieldsViewLabel(3) = oViewType & "FROM " & oParentView.Name & " " & oDrawingCustomIProps.Item(sPropName).Value()

				oOffsetFromBaseView = 2.5 'arbitrary distance'
				oViewLabelPosition = oTransGeom.CreatePoint2d(oView.Position.X, oView.Position.Y - (oView.Height/2) - oOffsetFromBaseView)
				oSketchSym = oViewSheet.SketchedSymbols.Add(oViewLabel, oViewLabelPosition, 0, 1, sPromptFieldsViewLabel)
			End If

			Dim oViewVector As Vector
			Dim oParentViewVector As Vector
			Dim oParentViewUpVector As Vector
			Dim oCrossVector As Vector
			
			oViewVector = GetViewVector(oView)
			oParentViewVector = GetViewVector(oParentView)
			oParentViewUpVector = oParentView.Camera.UpVector.AsVector
			oCrossVector = oParentViewUpVector.CrossProduct(oViewVector) 

			oRotation = NormalizeAngle(oParentViewUpVector.AngleTo(oViewVector), False)				
				If oViewVector.IsParallelTo(oParentViewUpVector) And oRotation = PI Then
					oAngle = 0
				ElseIf oViewVector.IsParallelTo(oParentViewUpVector) And oRotation = 0 Then
					oAngle = PI
				Else
					oCrossVector.Normalize
					oParentViewVector.Normalize
					If oCrossVector.IsEqualTo(oParentViewVector, .000087266)'.005)
						oAngle = oRotation + PI
					Else
						oAngle = oRotation
					End If
				End If

			If oView.ViewType() = 10504 And oViewSheet IsNot oParentViewSheet Then 'projected view

				oOffsetFromBaseView = 1.25 'a completely arbitrary distance

				If oAngle = 1.5*PI Then
					oPosition = oTransGeom.CreatePoint2d(oParentView.Position.X - (oParentView.Width)/2 - oOffsetFromBaseView, oParentView.Position.Y)
				ElseIf oAngle = 0.5*PI Then
					oPosition = oTransGeom.CreatePoint2d(oParentView.Position.X + (oParentView.Width)/2 + oOffsetFromBaseView, oParentView.Position.Y)
				ElseIf oAngle = 0 Then
					oPosition = oTransGeom.CreatePoint2d(oParentView.Position.X, oParentView.Position.Y - (oParentView.Height/2) - oOffsetFromBaseView) 'place call out below view 
					'oParentView.Label.Position = oTransGeom.CreatePoint2d(oParentView.Position.X, oParentView.Position.Y - (oParentView.Height/2) - 2*oOffsetFromBaseView) ??I can't remember what this does
				ElseIf oAngle = PI Then
					oPosition = oTransGeom.CreatePoint2d(oParentView.Position.X, oParentView.Top + oOffsetFromBaseView) 'place call out above view 
				End If			

				sPromptFieldsCallOut(0) = oView.Name
				sPropName = "SheetNumber" & oViewSheetIndex
				sPromptFieldsCallOut(1) = oDrawingCustomIProps.Item(sPropName).Value()

				oSketchSym = oParentViewSheet.SketchedSymbols.Add(oCallOutArrow, oPosition, oAngle, 1, sPromptFieldsCallOut)

				oSketchSym = oParentViewSheet.SketchedSymbols.Add(oCallOut, oPosition, 0, 1, sPromptFieldsCallOut)
			
			ElseIf oView.ViewType() = 10503 Then 'section view

				'MessageBox.Show(oRotation, oView.Name)
				'MessageBox.Show(oAngle, oView.Name)
				MessageBox.Show (oView.Name, oParentView.Name)
				oView.ShowEntireLine = True
				'oView.ScaleFromBase = True 'I took this out so it doesn't rescale the section views BG

				Dim oParentViewPosition As Point2d
				oParentViewPosition = oParentView.Center

				Dim oSecLine As DrawingSketch
				oSecLine = oView.SectionLineSketch
				Dim oSketchLine As SketchLine

				Dim oCallOutPosition As Point2d						
				Dim oCallOutOffset As Double
				Dim oCallOutOffsetVector As Vector2d

				oCallOutOffset = 0.4445  'from the radius of the sketched symbol

				'oRotation = NormalizeAngle(oParentViewUpVector.AngleTo(oViewVector), False)

				For Each oSketchLine In oSecLine.SketchLines
					If oSketchLine.Reference = False Then
						'Dim oDirection As UnitVector2d
						'oDirection = oSketchLine.Geometry.Direction
						'Dim oZeroAngle As UnitVector2d
						'oZeroAngle = oTransGeom.CreateUnitVector2d(0,1) 'setting 12:00 to the 0 degree rotation base

						'find the highest or rightest point, not the maxpoint'
						Dim oSecLineStart As Point2d
						Dim oSecLineEnd As Point2d
						oSecLineStart = oSketchLine.StartSketchPoint.Geometry
						oSecLineEnd = oSketchLine.EndSketchPoint.Geometry

						If oSecLineStart.X > oSecLineEnd.X And oSecLineStart.Y > oSecLineEnd.Y Then  'down to left
							oPosition = oSecLineStart
							oCallOutOffsetVector = oTransGeom.CreateVector2d(ABS(oCallOutOffset*(COS(oRotation)))/oView.Scale, ABS(oCallOutOffset*(SIN(oRotation)))/oView.Scale)
							oPosition.TranslateBy(oCallOutOffsetVector)
							'may need to change to oParentView.Scale'
						
						Else If oSecLineStart.X < oSecLineEnd.X And oSecLineStart.Y < oSecLineEnd.Y Then 'up to right
							oPosition = oSecLineEnd
							oCallOutOffsetVector = oTransGeom.CreateVector2d(ABS(oCallOutOffset*(COS(oRotation)))/oView.Scale, ABS(oCallOutOffset*(SIN(oRotation)))/oView.Scale)
							oPosition.TranslateBy(oCallOutOffsetVector)

						Else If oSecLineStart.X > oSecLineEnd.X And oSecLineStart.Y < oSecLineEnd.Y Then 'up to left
							oPosition = oSecLineEnd
							oCallOutOffsetVector = oTransGeom.CreateVector2d(0-ABS(oCallOutOffset*(COS(oRotation)))/oView.Scale, ABS(oCallOutOffset*(SIN(oRotation)))/oView.Scale)
							oPosition.TranslateBy(oCallOutOffsetVector)							

						Else If oSecLineStart.X < oSecLineEnd.X And oSecLineStart.Y > oSecLineEnd.Y Then 'down to right
							oPosition = oSecLineStart
							oCallOutOffsetVector = oTransGeom.CreateVector2d(0-ABS(oCallOutOffset*(COS(oRotation)))/oView.Scale, ABS(oCallOutOffset*(SIN(oRotation)))/oView.Scale)
							oPosition.TranslateBy(oCallOutOffsetVector)							

						Else If oSecLineStart.X = oSecLineEnd.X Then
							oPosition = oTransGeom.CreatePoint2d(oSketchLine.RangeBox.MaxPoint.X, oSketchLine.RangeBox.MaxPoint.Y + oCallOutOffset/oView.Scale)

						Else If oSecLineStart.Y = oSecLineEnd.Y Then
							oPosition = oTransGeom.CreatePoint2d(oSketchLine.RangeBox.MaxPoint.X + oCallOutOffset/oView.Scale, oSketchLine.RangeBox.MaxPoint.Y)
						Else 
						End If
					End If
				Next 'next sketch line of section line sketch

				oCallOutPosition = oTransGeom.CreatePoint2d(oPosition.X*oView.Scale + oParentViewPosition.X, oPosition.Y*oView.Scale + oParentViewPosition.Y)

				sPromptFieldsCallOut(0) = oView.Name
				sPropName = "SheetNumber" & oViewSheetIndex
				sPromptFieldsCallOut(1) = oDrawingCustomIProps.Item(sPropName).Value()

				oSketchSym = oParentViewSheet.SketchedSymbols.Add(oCallOutArrow, oCallOutPosition, oAngle, 1, sPromptFieldsCallOut) ' pi-oAngle works half the time....'
				'MessageBox.Show(oRotation,"oRotation")
				oSketchSym = oParentViewSheet.SketchedSymbols.Add(oCallOut, oCallOutPosition, 0, 1, sPromptFieldsCallOut)
			End If
 		End If
	Next 'next view on sheet
	Catch '9/1/2016
	End Try '9/1/2016
Next 'next sheet


Dim oTopNode As BrowserNode
oTopNode = oDrawing.BrowserPanes.ActivePane.TopNode

Dim oNode As BrowserNode
For Each oNode In oTopNode.BrowserNodes
	If oNode.Visible = True And oNode.Expanded = True Then
	oNode.Expanded = False
	End If
Next

iLogicVb.UpdateWhenDone = True

End Sub

Function GetViewVector(oView As DrawingView) As Vector
	Dim oTransGeom As TransientGeometry
	oTransGeom = ThisApplication.TransientGeometry
	
	Dim oCamera As Camera
	oCamera = oView.Camera
	
	Dim oCameraEye, oCameraTarget As Point
	oCameraEye = oCamera.Eye
	oCameraTarget = oCamera.Target
	
	Dim oViewVector As Vector
	oViewVector = oTransGeom.CreateVector(oCameraEye.X - oCameraTarget.X, oCameraEye.Y - oCameraTarget.Y, oCameraEye.Z - oCameraTarget.Z)
	'oViewVector = oTG.CreateVector(oCameraEye.X, oCameraEye.Y, oCameraEye.Z)
	Return oViewVector
End Function

Function NormalizeAngle(angle As Double, ReturnDegrees As Boolean)
	Dim oAngle As Double
	Dim multiple As Double
	If Math.Abs(angle) >= 2*Math.PI '360 degrees
		multiple = angle \ (2*Math.PI)
		oAngle = angle - multiple*2*Math.PI
	Else
		oAngle = angle
	End If

	'MessageBox.Show(oAngle, "oAngle")
	'MessageBox.Show(ReturnDegrees, "ReturnDegrees")

	If ReturnDegrees = False
		Return oAngle
	Else
		Return (180/Math.PI) * oAngle
	End If

End Function

 

 

 

0 Likes
Message 5 of 9

Anonymous
Not applicable

Thanks Brandon,

 

I agree with one of your comments in those linked posts, I can't believe that section view annotations have little to no functionality.

I got this working to a degree which was great, but as I investigated further the section symbol works great for sections but does not work for detail views as these don't have a sketch to interrogate.  Smiley Sad

 

This might be one for Inventor devs to incorporate me thinks.

 

Tim

0 Likes
Message 6 of 9

asiteur
Collaborator
Collaborator

Hi Tim,

 

Seeing your screenshots with SHT 2, how about adding a new document property to your file (e.g. <EXTRA_DRAWING_TEXT>) and then pushing the proper value to this property? This would work is the amount of different annotations is limited, but you like to update them every once in a while.

 

Would be very simple to implement. Just trying to think along with you.



Alexander Siteur
Project Engineer at MARIN | NL
LinkedIn

0 Likes
Message 7 of 9

BrandonBG
Collaborator
Collaborator

I couldn't figure out detail views either.

 

I ended up writing a separate iLogic chunk that adds the modified view label to any view I select. It's not linked to anything -- just a sketched symbol sitting on top of the drawing.

 

Dim oDrawing As DrawingDocument
oDrawing = ThisApplication.ActiveDocument

Dim oSheet As Sheet
oSheet = oDrawing.ActiveSheet

Dim oView As DrawingView
Dim oViewSheet As Sheet
Dim sPromptFieldsViewLabel(3) As String
Dim oViewLabelPosition As Point2d
Dim oOffsetFromBaseView As Double

Dim oSketchSym As SketchedSymbol
Dim oSketchSymLib As SketchedSymbolDefinitionLibrary
oSketchSymLib = oDrawing.SketchedSymbolDefinitions.SketchedSymbolDefinitionLibraries.Item("Library")

Dim oViewLabel As SketchedSymbolDefinition
oViewLabel = oDrawing.SketchedSymbolDefinitions.AddFromLibrary(oSketchSymLib, "ViewLabel", True)

Dim oTransGeom As TransientGeometry
oTransGeom = ThisApplication.TransientGeometry

While True

oView = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingViewFilter, "Select view to label. ESC to end.")

	If IsNothing(oView) Then Exit While

		oViewSheet = oView.Parent
		sPromptFieldsViewLabel(0) = oView.Name
		sPromptFieldsViewLabel(1) = oView.ReferencedDocumentDescriptor.ReferencedDocument.PropertySets.Item("Design Tracking Properties").Item("Stock Number").Value & " " & oView.ReferencedDocumentDescriptor.ReferencedDocument.PropertySets.Item("Design Tracking Properties").Item("Description").Value
		sPromptFieldsViewLabel(2) = "SCALE " & oView.ScaleString
		sPromptFieldsViewLabel(3) = ""

		oOffsetFromBaseView = 2.5 'arbitrary distance'
		oViewLabelPosition = oTransGeom.CreatePoint2d(oView.Position.X, oView.Position.Y - (oView.Height/2) - oOffsetFromBaseView)
		oSketchSym = oViewSheet.SketchedSymbols.Add(oViewLabel, oViewLabelPosition, 0, 1, sPromptFieldsViewLabel)

End While 

'iLogicVb.UpdateWhenDone = True

I've spent way too much time figuring this out because I thought it HAD to be an easy modification. It wasn't!

 

Brandon

0 Likes
Message 8 of 9

ahobby
Contributor
Contributor

@BrandonBG

 

in the part of your code where you define the sketch symbol library, is that just the sketch symbol library in the drawing or does that reference to somewhere else (i.e. a folder on a disk)?

 

If its just the sketch symbol in the active drawing, and my sketch symbols folder is just the defaul "sketch symbols" name, would the below be correct?

 

SyntaxEditor Code Snippet

Dim oSketchSym As SketchedSymbol
Dim oSketchSymLib As SketchedSymbolDefinitionLibrary
oSketchSymLib = oDrawing.SketchedSymbolDefinitions.SketchedSymbolDefinitionLibraries.Item("Sketch Symbols")

 

Second question:

 

I'm assuming for the code to run there needs to be an existing sketch symbol titled  "viewlabel" in the sketch symbol library, with prompted entries 0-3 (i.e. 4 total) - I'm pretty new to ilogic and still just figuring out the basic by copying code and tweaking it.

 

sPromptFieldsViewLabel(0) = oView.Name
		sPromptFieldsViewLabel(1) = oView.ReferencedDocumentDescriptor.ReferencedDocument.PropertySets.Item("Design Tracking Properties").Item("Stock Number").Value & " " & oView.ReferencedDocumentDescriptor.ReferencedDocument.PropertySets.Item("Design Tracking Properties").Item("Description").Value
		sPromptFieldsViewLabel(2) = "SCALE " & oView.ScaleString
		sPromptFieldsViewLabel(3) = ""

 

I'm getting the following error

 

System.ArgumentException: The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
at Inventor.SketchedSymbolDefinitionLibraries.get_Item(Object Index)
at LmiRuleScript.Main()
at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)
at iLogic.RuleEvalContainer.ExecRuleEval(String execRule)

 

And yes, the fact that inventor users even have to do this stuff to put the most BASIC of drawing symbols on the sheets is incredibly frustrating. 

 

0 Likes
Message 9 of 9

BrandonBG
Collaborator
Collaborator
Yes, you need to define "viewlabel" in the drawing template sketch symbols. It will work in the existing drawing file, but it's easier long term to go back to the template file and set up all your custom symbols and text blocks. The prompted fields are defined within the sketch symbol.
I'm using the default sketch symbol library. I suppose you could make multiple custom libraries, but I don't really need to. All the fields are default Inventor iProperties (which are also maddeningly difficult to access since the system names a significantly different than the user names).
This method is far from perfect. It works most of the time as long as the drawing references are sort of linear.
Brandon
0 Likes