How to execute command for invisible drawing document using Inventor API?

How to execute command for invisible drawing document using Inventor API?

Anton_Chernomazov
Contributor Contributor
689 Views
4 Replies
Message 1 of 5

How to execute command for invisible drawing document using Inventor API?

Anton_Chernomazov
Contributor
Contributor

Good day. I'm using 'DrawingCropViewCmd' command to crop drawing view. It works in case drawing document is opened with option Visible = true. But in case document is invisible command execute does not work. Are there any ways to execute 'DrawingCropViewCmd' for invisible document?

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

Anton_Chernomazov
Contributor
Contributor

I just find that necessary control definition has Enabled = false. May be enabling this control definition can help but I don't know how to do it.

0 Likes
Message 3 of 5

JhoelForshav
Mentor
Mentor

Hi @Anton_Chernomazov 

I'd say executing a controldefinition like that for an invisible document is not possible. What you do is basically clicking the crop button. You do it by code but the command still needs to have an active visible drawing document open, preferably with a closed profile selected in it's select set for this specific command. There is no passing of arguments involved here so you can't really tell the command to act on a specific document. It simply behaves exactly the way it would if you clicked the button in the UI.

Message 4 of 5

Anton_Chernomazov
Contributor
Contributor

Thank you for reply. I keep seaching for another way to solve my task. May be you know how to crop drawing view without ControlDefinition execute?

0 Likes
Message 5 of 5

JhoelForshav
Mentor
Mentor

@Anton_Chernomazov 

It seems there is no crop-functionality exposed through the API...

This thread is from 2010 but I can't find any indications that the functionality has been added since☹️

https://forums.autodesk.com/t5/inventor-customization/crop-drawing-view-through-api/td-p/2834761