Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Changing section callout

3 REPLIES 3
Reply
Message 1 of 4
Chassuer
965 Views, 3 Replies

Changing section callout

I am being tasked to create some customizing for our Inventor 2015 IDW's. One of the issues I am having is the section callout. It just shows an arrow and the section letter. is there a way to make this to be a circle with an arrow and sheet number. I have included a jpg.

Thank you

3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: Chassuer

I second this request!

Message 3 of 4
MechMachineMan
in reply to: Anonymous

Look here. I posted a Sub that can accomplish this. As you are showing. Given tha tthe symbol you use is 2 prompted entries rather than pulling a section view letter.

 

http://forums.autodesk.com/t5/inventor-customization/max-point-of-section-line/td-p/5723572


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
Message 4 of 4
BrandonBG
in reply to: Chassuer

I'm going to post the iLogic code I'm working on with the caveat that IT DOES NOT WORK.

 

It's a work in progress. Anyone at Autodesk thinking of setting up a repository for iLogic code?

 

I have 4 sketched symbols. Up, Down, Right, and Left. I'm not using the sheet number, but a 2.3 style page numbering system. So there's a reference to another external rule to generate those page numbers.

 

This kinda works and kinda doesn't. My code is rather verbose, and I still haven't figured out the section line pick.

 

YOU HAVE BEEN WARNED! Use this as inspiration or as a lesson on how not to write efficient code.

 

Brandon

 

 

'THIS WILL NOT CORRECTLY FUNCTION!
'I AM POSTING THIS FOR DISCUSSION PURPOSES ONLY
'THIS IS A WORK IN PROGRESS

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 oSketchedSymbols As SketchedSymbols Dim oSketchedSymbol As SketchedSymbol Dim oSketchedSymbolLibrary As SketchedSymbolDefinitionLibrary Dim oTransientGeometry As TransientGeometry oTransientGeometry = ThisApplication.TransientGeometry sViewLabels = New String(){"A","B","C","D","E","F","G","H","J","K","L","M","N","P","R","S","T","U","V","W","X","Y","Z"} Dim iViewCount = 0 Dim oDrawingIProperties As PropertySets oDrawingIProperties = oDrawing.PropertySets Dim oDrawingCustomIProperties As PropertySet 'point to Custom iProperties' oDrawingCustomIProperties = oDrawingIProperties.Item("Inventor User Defined Properties") iLogicVb.RunExternalRule("dwgRenumberSheets") 'confirms that the iProperties for the page numbers are created 'assuming there are no drawing views on sheet 1 For i = 2 To iSheetCount oSheet = oSheets.Item(i) 'deletes existing call outs since we can't update them For Each oSketchedSymbol In oSheet.SketchedSymbols If oSketchedSymbol.Name = "up" Then oSketchedSymbol.Delete Else If oSketchedSymbol.Name = "down" Then oSketchedSymbol.Delete Else If oSketchedSymbol.Name = "left" Then oSketchedSymbol.Delete Else If oSketchedSymbol.Name = "right" Then oSketchedSymbol.Delete End If Next oPreviousSheet = oSheets.Item(i-1) oViews = oSheet.DrawingViews oPreviousViews = oPreviousSheet.DrawingViews 'turns on the label for the first view on the sheet oViews.Item(1).ShowLabel = True 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 For Each oView in oSheet.DrawingViews oViewSheet = oView.Parent oParentView = oView.ParentView If oParentView IsNot Nothing Then oParentViewSheet = oParentView.Parent If oViewSheet IsNot oParentViewSheet Then oSketchedSymbolLibrary = oDrawing.SketchedSymbolDefinitions.SketchedSymbolDefinitionLibraries.Item("Library") Dim oDefUp As SketchedSymbolDefinition oDefUp = oDrawing.SketchedSymbolDefinitions.AddFromLibrary(oSketchedSymbolLibrary, "up", True) Dim oDefDown As SketchedSymbolDefinition oDefDown = oDrawing.SketchedSymbolDefinitions.AddFromLibrary(oSketchedSymbolLibrary, "down", True) Dim oDefLeft As SketchedSymbolDefinition oDefLeft = oDrawing.SketchedSymbolDefinitions.AddFromLibrary(oSketchedSymbolLibrary, "left", True) Dim oDefRight As SketchedSymbolDefinition oDefRight = oDrawing.SketchedSymbolDefinitions.AddFromLibrary(oSketchedSymbolLibrary, "right", True) Dim oPosition As Point2d Dim sPromptedFields(1) As String Dim sF1 As String Dim sF2 As String sF1 = "x" sF2 = "y" sPromptedFields(0) = sF1 sPromptedFields(1) = sF2 Dim oParentViewSheetName As String Dim oViewSheetName As String oParentViewSheetName = oParentViewSheet.Name oViewSheetName = oViewSheet.Name Dim oParentColonIndex As Integer Dim oViewColonIndex As Integer oParentColonIndex = oParentViewSheetName.IndexOf(":") oViewColonIndex = oViewSheetName.IndexOf(":") Dim oParentViewSheetNameLength As Integer Dim oViewSheetNameLength As Integer oParentViewSheetNameLength = Len(oParentViewSheetName) oViewSheetNameLength = Len(oParentViewSheetName) Dim oParentViewSheetIndex As String Dim oViewSheetIndex As String oParentViewSheetIndex = Right(oParentViewSheetName, oParentViewSheetNameLength - oParentColonIndex - 1) oViewSheetIndex = Right(oViewSheetName, oViewSheetNameLength - oViewColonIndex - 1) 'MessageBox.Show(sPromptedFields(0), sPromptedFields(1)) If oView.ViewType() = 10504 Then 'projected view oPosition = oParentView.Position sPromptedFields(0) = oView.Name Dim sPropertyName As String sPropertyName = "SheetNumber" & oViewSheetIndex 'NEED TO CORRECT ORIENTATION FOR UP-DOWN-LEFT-RIGHT' sPromptedFields(1) = oDrawingCustomIProperties.Item(sPropertyName).Value() oSketchedSymbol = oParentViewSheet.SketchedSymbols.Add(oDefUp, oPosition, 0, 1, sPromptedFields) ElseIf oView.ViewType() = 10503 Then 'section view oView.ShowEntireLine = True Dim oParentViewPosition As Point2d oParentViewPosition = oParentView.Center Dim oSectionLine As DrawingSketch oSectionLine = oView.SectionLineSketch Dim oSketchLine As SketchLine Dim aSketchLineMax As New ArrayList For Each oSketchLine In oSectionLine.Sketchlines aSketchLineMax.Add(oSketchLine.RangeBox.MaxPoint) Next 'oPosition = MaxOfMany(aSketchLineMax) 'oPosition = oSectionLine.SketchLines.Item(2).RangeBox.MaxPoint oPosition = oSectionLine.SketchLines.Item(1).StartSketchPoint.RangeBox.MaxPoint 'oPosition = oParentView.Position Dim oCallOutPosition As Point2d 'oCallOutPosition = oParentViewPosition 'MessageBox.Show(oView.Scale, "Scale") 'oCallOutPosition = oTransientGeometry.CreatePoint2d((oPosition.X - oParentViewPosition.X)*oView.Scale, (oPosition.Y - oParentViewPosition.Y)*oView.Scale) oCallOutPosition = oTransientGeometry.CreatePoint2d(oPosition.X*oView.Scale + oParentViewPosition.X, oPosition.Y*oView.Scale + oParentViewPosition.Y) 'oCallOutPosition = oPosition sPromptedFields(0) = oView.Name Dim sPropertyName As String sPropertyName = "SheetNumber" & oViewSheetIndex sPromptedFields(1) = oDrawingCustomIProperties.Item(sPropertyName).Value() 'MessageBox.Show(oParentView.Camera.ViewOrientationType, "parent") If (oParentView.Camera.ViewOrientationType = 10764 And oView.Camera.ViewOrientationType = 10755) or (oParentView.Camera.ViewOrientationType = 10755 And oView.Camera.ViewOrientationType = 10756) or (oParentView.Camera.ViewOrientationType = 10756 And oView.Camera.ViewOrientationType = 10758) Then 'front to right or right to back or back to left' oSketchedSymbol = oParentViewSheet.SketchedSymbols.Add(oDefLeft, oCallOutPosition, 0, 1, sPromptedFields) MessageBox.Show(oCallOutPosition.X, oCallOutPosition.Y) ElseIf (oParentView.Camera.ViewOrientationType = 10764 And oView.Camera.ViewOrientationType = 10758) or (oParentView.Camera.ViewOrientationType = 10758 And oView.Camera.ViewOrientationType = 10756) or (oParentView.Camera.ViewOrientationType = 10756 And oView.Camera.ViewOrientationType = 10755) Then 'front to left or left to back or back to right' oSketchedSymbol = oParentViewSheet.SketchedSymbols.Add(oDefRight, oCallOutPosition, 0, 1, sPromptedFields) MessageBox.Show(oCallOutPosition.X, oCallOutPosition.Y) End If End If End If End If Next Next iLogicVb.UpdateWhenDone = True

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report