05-21-2024
07:30 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
05-21-2024
07:30 AM
@mat_hijs , I think I might have figured it out. If I add a line to specify the CC language in the function then it works without error in the Internal and External rules.
For me the language syntax is en-US
Public Class Glassteun Public Property Category As String = "Fasteners:Nuts:Hex" Public Property Name As String Public Property Number As String Public Property Visible As Boolean Public Property Components As IManagedComponents Public Property Component As ICadComponent Public Sub New(Components As IManagedComponents, Component As ICadComponent) Me.Components = Components Me.Component = Component End Sub Public Function Place() As Inventor.ComponentOccurrence Components.ContentCenterLanguage = "en-US" Dim oOcc As Inventor.ComponentOccurrence '*****This is a workaround for a bug, see this forum post: https://forums.autodesk.com/t5/inventor-programming-ilogic/place-content-center-bug/td-p/12727134***** '**************************************************************************************************************************************************************** Try If Name <> "" Then Component.Visible(Name) = True Catch End Try '**************************************************************************************************************************************************************** '**************************************************************************************************************************************************************** If Name = "" Then Name = "TempName" Components.AddContentCenterPart(Name, Category, Number, Number, , False, , ) Component.Visible(Name) = Visible oOcc = Component.InventorComponent(Name) If Name = "TempName" Then oOcc.Name = "" Return oOcc End Function End Class