Drawing won't update unless i click on Assembly then Drawing

Drawing won't update unless i click on Assembly then Drawing

anthony.alam
Participant Participant
625 Views
4 Replies
Message 1 of 5

Drawing won't update unless i click on Assembly then Drawing

anthony.alam
Participant
Participant

Hello, i made an assembly that takes input from a Form, passes these properties to each part, updates everything. Then it opens a Drawing and exports it as PDF and DWG.

Everything works perfectly.

 

Now I am trying to Generate multiple Drawings with different Dimensions each. So I included an Excel file and let a Rule ieterate between different rows, and after each one it will fire the precedent rules and exports them.

 

The Drawing is updating at each iteration, however the drawing is not, it's just exporting the existing dimensions.

I tried including commands to update, rebuild, execute pending actions, update views,... but nothing is working.

 

I included the files in attachment. Could someone help please?

 

 

0 Likes
626 Views
4 Replies
Replies (4)
Message 2 of 5

A.Acheson
Mentor
Mentor

Can you attach the code your using?

Also you may need to directly update the assembly.

Something like

 

Dim oDoc As AssemblyDocument = ThisDoc.Document

oDoc.Update()

 

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

anthony.alam
Participant
Participant

Thank you for reaching out.

I tried this command, still wont work.

 

Also, i noticed that when i click on the Part and click back on the Drawing, it updates automatically but the export would have been already executed with the unupdated parameters.

 

Below are attached the Rules used on the Assembly level.

0 Likes
Message 4 of 5

A.Acheson
Mentor
Mentor

Unfortunately I don't have a rar extractor and also only have Inv 2020. All I can suggest is to place a message box after the dimensions are updated and you will likely see the orange lighting bolt This will need to be cleared before the update is seen in the drawing. Usually done with an update of the document object.

 

You may also need to have the drawing updated. Again some message boxes will help you see what is happening when. On another note depending on where you launch the rules from you may need to use a "document.activate" line to ensure the document your in is the one receiving focus. 

 

If you have a video of the process that could help. Otherwise maybe another forum member can analyze the files you have provided. 

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

anthony.alam
Participant
Participant

Thank you for the reply,

this message box method is really usefull!

 

I used thisDoc.document.activate in both the assembly and the drawing to activate each window when it's being executed. However it didn't solve my problem.

 

Also, i am noticing that somehow the drawing is being executed and exported before the assembly update happens. i tried all sortes of ways to force it to update, (but when the code finishes and i click on the assembly window, it updates automatically).

 

few of the commands i tried are below: 

iLogicVb.UpdateWhenDone = True
InventorVb.DocumentUpdate()
InventorVb.DocumentUpdate(False)
ThisApplication.ActiveView.Update()
ThisDoc.Save
ThisDoc.Document.Rebuild2
ThisDoc.Document.Update2

could you please help?

 

0 Likes