Changing length of a content centre part

Changing length of a content centre part

217694G9MEZ
Participant Participant
570 Views
3 Replies
Message 1 of 4

Changing length of a content centre part

217694G9MEZ
Participant
Participant

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)

 

0 Likes
Accepted solutions (1)
571 Views
3 Replies
Replies (3)
Message 2 of 4

Ralf_Krieg
Advisor
Advisor
Accepted solution

Hello

 

Just a typo?

oNv.Add("G_L", 400) '<-- "B_L" instead?

I think 10mm is the standard value if the NameValueMap does not contain a valid entry for required custom input.


R. Krieg
RKW Solutions
www.rkw-solutions.com
0 Likes
Message 3 of 4

217694G9MEZ
Participant
Participant

Hello,

i’ve tried it with - B_L, G_L, Size, Length and so on. Its important to say that I didnt do these CC parts. There is supposed to be a parametr thats linked to the height, no?   When i open the custom created CC part, i open parametrs and there is G_L linked with height. 

0 Likes
Message 4 of 4

217694G9MEZ
Participant
Participant
So it was just a typo. It had different name, thanks. 🙂
0 Likes