How to change user parameters in an assembly component using VB.net

How to change user parameters in an assembly component using VB.net

Anonymous
Not applicable
643 Views
3 Replies
Message 1 of 4

How to change user parameters in an assembly component using VB.net

Anonymous
Not applicable

This may be straightforward for some, but I have spent 2 days trying to find the correct route.

Basically I am using vb.net to control an assembly and I wish to change a parameter of a component within that assembly. i.e. it's length.

All the examples I have found start by assuming the part in question is active.

Depending on options chosen, I wish to select the part to be amended by it's part name etc, and then set a new value to one of it's parameters.

 

Any help would be greatly appreciated.

 

Thank you

0 Likes
644 Views
3 Replies
Replies (3)
Message 2 of 4

johnsonshiue
Community Manager
Community Manager

Hi! I could be wrong but I think this should be highly doable. Another route is to use iLogic rule (also VB.Net  technology). You can reference or edit any parameter from any component within the assembly.

Many thanks!

 



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
0 Likes
Message 3 of 4

Anonymous
Not applicable

Hi, and thanks for the reply. I have done this very successfully in iLogic already. The reason for the .Net route now is we are planning on setting up a remote watch on a server. When files appear in it, the relevant models are loaded, redrawn and saved automatically.

It does seem like it should be straightforward, I just need to find the right way of doing it.

 

0 Likes
Message 4 of 4

MjDeck
Autodesk
Autodesk

Here's an outline of a way to do it:

- starting from the assembly, get its AssemblyDocument.AllReferencedDocuments
- iterate over the documents and find the one you want (probably by the file name)
- cast that document to a PartDocument
- get the PartDocument.ComponentDefinition.Parameters, and find the parameter you need in there

 

 


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes