End Section view before Save. Why does it work this way and how to fix it ?

End Section view before Save. Why does it work this way and how to fix it ?

Darkforce_the_ilogic_guy
Advisor Advisor
682 Views
4 Replies
Message 1 of 5

End Section view before Save. Why does it work this way and how to fix it ?

Darkforce_the_ilogic_guy
Advisor
Advisor

I have a ilogic run before save on assembly. but after save Inventor believe that there is a change to the file. Why?

 

My code look like this

 

'remove Endsections when save

Dim oApp As Inventor.Application = ThisApplication

oApp.CommandManager.ControlDefinitions("AssemblyEndSectionViewCmd").Execute

 

I would like to know a few thing....

 

why does it say the file  even after it is save and the code is run before save ?

 

how is it possible to make a check if there is a Section view .. and only run the rest of the code if section view is aktive

 

and how does that code look like

 

 

 

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

CCarreiras
Mentor
Mentor

Hi!

 

"....but after save Inventor believe that there is a change to the file. Why?"

What do you mean by that?

 

'remove Endsections when save

This is just a comment, just an information line, doesn't do anything real.

 

 

Probably the rule is associated to an EVEN TRIGGER that makes the rule run after or before saving, depending on what you chose in the event trigger chart.

Tip: I guess the better option will be when you close the document.

ccarreiras_0-1672659337290.png

 

I believe You don't need a more complicated code... if you have a section, the rule will clear the section, if you don't have a section, the rule does nothing.

 

CCarreiras

EESignature

Message 3 of 5

Darkforce_the_ilogic_guy
Advisor
Advisor

Hi ccarreiras

 

the code does what it need to. But for some reasom inventor mark the files as a change have happen after save with the mark *. In for vault fane. This normal happen if you have change somthing after last time you save..

 

Sind I use the Before Save document Event. I do not understand why inventor see the files as change  after save. When I use that code in Before save document

 

0 Likes
Message 4 of 5

A.Acheson
Mentor
Mentor

This could be a timing issue. You can try the Execute2 method for control definition. 

Put a message box after command execute2 and adjust true/false and note the timing before save dialogue. 

 

The saving is not waiting for the command to finish. 

 

 

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

johnsonshiue
Community Manager
Community Manager

Hi! I believe the graphics section view is a Design View Rep modifier. When the section view is ended, the active Design View Rep has been changed and it has to be saved.

Many thanks!

 



Johnson Shiue ([email protected])
Software Test Engineer
0 Likes