Adding Exit Button for Custom Environment

thomas.fullerD3PYA
Explorer
Explorer

Adding Exit Button for Custom Environment

thomas.fullerD3PYA
Explorer
Explorer

Is there a way, using the Inventor API, to create a contextual Exit Tab (see the attached image)? 
this is similar to this question a while back (Here), which works only when using the environment in parallel. 

 

From what I can tell, the "Exit" panel is actually a RibbonTab, but I'm not entirely sure how this is displayed within all the Tabs in the Ribbon.

 

I currently have a hacky solution where I use the contextual "Return" tab, hide the standard return panel ("return", "return to parent" ect.) and show my panel instead, but I'm wondering;  is there a proper way of doing this?

 

I want this Environment to launch when the user drills down into a part within an assembly, without having to go to the environments tab.

 

thomasfullerD3PYA_0-1673862895564.png

 

0 Likes
Reply
283 Views
2 Replies
Replies (2)

bradeneuropeArthur
Mentor
Mentor
Could you please try to explain a bit better for me what you try to do?
Maybe some screenshots and steps included.
Thanks in advance,

Regards,

Arthur Knoors

Autodesk Affiliations:

Autodesk Software:Inventor Professional 2024 | Vault Professional 2022 | Autocad Mechanical 2022
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: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 !

0 Likes

thomas.fullerD3PYA
Explorer
Explorer

Here is what I am trying to achieve (similar to Tube & Pipe Routing)

  1. User Presses custom "Create Route" button. :white_heavy_check_mark:
  2. Inventor creates new part to host a 3dSketch, and adds to the current assembly :white_heavy_check_mark:
  3. Upon this new part becoming the ActiveEditDocument, Begin the edit on the sketch instead (I don't want the user to be able to edit anything in the part document, other than the Sketch3d) :white_heavy_check_mark:
  4. When edit has begun on the sketch, I want to set the environment to a custom one, based off the sketch3d environment, which includes an extra contextual tab and an including an exit tab/button. :stop_sign:

I've managed to do all but the last step, whenever I try and set the current environment when the ActiveEditObject is not a document, I get errors.

 

What I've done to get around this is:

  • Add another button to the Sketch3D Enviroment's exit tab, but make it not visible
  • During step 2, assign a DocuemtnInterest to the PartDocument, so I can identify during EnvironmentChange event
  • On step 3, set the current environment to my custom one (this correctly sets the ExitDisplayName), then proceed to edit sketch 
  • When EnvironmentChange event fires (when switching to the sketch), check the document interests, if it does contain my previously created one, make my custom contextual tab visible and change the visibility of my exit button, so that it is the only one in the exit tab.

As you can see there is a lot of faf, so I'm wondering a couple of things:
Is it possible to start a parallel environment without user interaction (that may solve this)?
Is it possible to build an environment with its own Exit Tab? like the tube and pipe environments

 

0 Likes