Open assembly from Part File and run rule from assembly

Open assembly from Part File and run rule from assembly

Anonymous
Not applicable
355 Views
2 Replies
Message 1 of 3

Open assembly from Part File and run rule from assembly

Anonymous
Not applicable

Hi

 

I need to open assembly file from part file and make the assembly file as active document then run external rule,

 

can you please suggest some code

 

the below code is not working

 

 

Dim sFilePath As String
Dim oDoc As Inventor.AssemblyDocument
sFilePath = "P:\Bd_NSPB\Assembly_new\Sl_lv_assy_NSPB.iam"
oDoc = ThisApplication.Documents.Open(sFilePath,True)
oDoc.Activate()
iLogicVb.RunExternalRule("Dxf_out")
''InventorVb.DocumentUpdate()

 

 

 

thanks in advance

 

V.Sureshkumar

 

0 Likes
356 Views
2 Replies
Replies (2)
Message 2 of 3

bradeneuropeArthur
Mentor
Mentor

Hi,

For me the code is working till the external rule.

Because I don't have the external rule, I cannot test it.

 

there seems to be something wrong in the external rule!

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 3 of 3

Anonymous
Not applicable

Dear Braden

Good day

 

my code is working for me too, but the issue is i want to make my assembly file is current active file and ilogic external rules should take some iproperties value from assembly file, but now the part file is active

 

my requirement is below

 

Step-1 - Open assembly file from part file using specific location and file name

Step-2 - Set assembly file is active file

Step-3 - Update Assembly file

Step-4 - Create Flat Pattern (DXF) file for each reference parts in the assembly (Only Sheet metal parts)

              (While creating the Dxf file the system should take the file from current part iproperties value (Part Number & Revision Number)

 

my issue now is that, since my assembly file is not a current file, system not taking the iproperties value from part file and all the dxf file overwrite as a single file (last saved file)

 

where as, if i run my external rule directly from assembly, its working file

 

please see my two snap shot and video for your easy reference

 

 

 

thanks

 

v.sureshkumar

 

 

 

 

0 Likes