Cannot modify parameters in a sub-assembly from the main assembly

Cannot modify parameters in a sub-assembly from the main assembly

m_baczewski
Advocate Advocate
564 Views
4 Replies
Message 1 of 5

Cannot modify parameters in a sub-assembly from the main assembly

m_baczewski
Advocate
Advocate

Hi,

I'm having an issue with changing parameters in a sub-assembly from the main assembly level. The problem occurs when I have Autodesk Inventor running and retrieve the model from Vault.

From the main assembly level, the sub-assembly in the API has the property IsModifiable = False, but if I open the sub-assembly, its IsModifiable property in the API is set to True.

If I close the main assembly and reopen it, the sub-assembly in the API has the IsModifiable property set to True, and then I can modify the sub-assembly through iLogic. All other elements in the main assembly and sub-parts always have IsModifiable = True.

Has anyone encountered a similar problem? How can I update the API at the main assembly level? oDoc.Update/Update2 doesn't work. How can I change these parameters without closing Inventor/Model? These parameters are related to the quantity of elements in the arrangement and the distances in the arrangement.


m_baczewski_0-1692781915528.png

 

0 Likes
Accepted solutions (2)
565 Views
4 Replies
Replies (4)
Message 2 of 5

A.Acheson
Mentor
Mentor

Hi @m_baczewski 

Can you attach your code your using to change parameter? That read only check is very strange and shouldn't be happening I would expect. Have you tried to open the assembly in memory with visibility False and access the parameter? 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 3 of 5

WCrihfield
Mentor
Mentor
Accepted solution

I have actually heard about that same behavior a few times before, and I was trying to find what other forum posts it was mentioned within, but haven't found it yet.  I believe that Mike Deck, an Autodesk employee, and Inventor API/iLogic guru, chimed in on the conversation too.  I believe that when assembly components have more than just the one original ModelState, and there is more than one component present in the assembly which reference the same 'file on disk' but reference different ModelStates (which means different Document), you run into this type of situation.  I think he said that they will be treaded as 'member' documents, which are usually ReadOnly.  I believe that you may be able to make changes to the first component (of all the ones referencing the same 'file'), but any other components (referencing the same file, but different ModelState) that you want to make edits/changes to, you will have to somehow update the document first, before it will let you make any changes to it.  It is an odd situation when both 'Documents' (both belonging to the same file on disk) are open in Inventor's 'session memory', so it needs to be handled differently.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 4 of 5

m_baczewski
Advocate
Advocate

The most important thing is that the model is not locked by an iLogic rule, but IsModifiable = False, after I check out this sub-assembly from Vault. Additionally, other sub-assemblies present in the model do not exhibit this behavior.

 

The code that causes this:

 

rozstawOtworow = SZEROKOSC_KOMINKA - 188.5
	'[ jeżeli szerokość kominka jest większa od 1000 dodaj dodatkową blachę jako uchwyt, działa jaK DELTA_CORNER_PUSZKA jest wypisana
If SZEROKOSC_KOMINKA > 1000 
	
	Feature.IsActive("BLACHA_SRODEK", "GRAWER") = True
	Parameter("DELTA_CORNER_PUSZKA", "ilosc_w_szyku_uchwyt") = 2
	Parameter("DELTA_CORNER_PUSZKA", "odleglosc_szyku_uchwyt") = (rozstawOtworow/2) + 11.45 - (roznicaSzerokosci/2)
Else
	Feature.IsActive("BLACHA_SRODEK", "GRAWER") = False
	Parameter("DELTA_CORNER_PUSZKA", "ilosc_w_szyku_uchwyt") = 1

End If
']

Additionally, this element: Feature.IsActive("BLACHA_SRODEK", "GRAWER") = True occurs in the DELTA_CORNER_PUSZKA sub-assembly, and I can edit this part normally.

0 Likes
Message 5 of 5

m_baczewski
Advocate
Advocate
Accepted solution

You are right, the reason is the model states that exist in the sub-assembly. Fortunately, these were old model states that I no longer need, so I could delete them. However, it doesn't change the fact that the error will always occur when having more than one model state. It's worth finding a solution for this in the future.

0 Likes