Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
i have problem changing length of a content centre part. I work in a company that has its own content centre. I have code for this, but for some reason, it changes the length to 10mm, when i wanted 400mm. Basicly, i need to change size of 4 component sizes based on input from Form. This code is just so i know the changing works, and then i will link it to the form.
Did anyone have same problem?
Thanks in advance.
The code:
Dim oDoc As AssemblyDocument = ThisDoc.Document Dim oDef As AssemblyComponentDefinition = oDoc.ComponentDefinition Dim oCC As ContentCenter = ThisApplication.ContentCenter Dim oCCmember As ComponentOccurrence = oDef.Occurrences.ItemByName( "0512 011.000 Profil vrat obvodvodový – L=2450mm – AL. přírodní:6") Dim propSet As PropertySet = oCCmember.Definition.Document.PropertySets.Item("{B9600981-DEE8-4547-8D7C-E525B3A1727A}") ' Get FamilyId property Dim familyId As Inventor.Property = propSet.Item("FamilyId") 'Get Family Dim oContentFamily As ContentFamily = oCC.GetContentObject("v3#" & familyId.Value & "#") ' Get MemberId property Dim strMemberId As String = propSet("MemberId").Value 'Get Row Dim oContentTableRow As ContentTableRow = oCC.GetContentObject("v3#" & familyId.Value & "#" & strMemberId) 'Replace member Dim ee As MemberManagerErrorsEnum 'B_L value Dim oNv As NameValueMap = ThisApplication.TransientObjects.CreateNameValueMap oNv.Add("G_L", 400) Dim oNewMember As String = oContentFamily.CreateMember(oContentTableRow, ee, "Some error occured", , False, , oNv) oCCmember.Replace(oNewMember, False)
Solved! Go to Solution.