Update Ortho Views via API

Update Ortho Views via API

tom.povey
Enthusiast Enthusiast
2,128 Views
14 Replies
Message 1 of 15

Update Ortho Views via API

tom.povey
Enthusiast
Enthusiast

Is it possible to update Ortho views via the Plant3D API?

 

I'm able to get all the views associated with an Ortho drawing, but i can't find any method related to updating or generating an ortho view.

 

Any help is appreciated.

 

Thanks,

Tom

0 Likes
2,129 Views
14 Replies
Replies (14)
Message 2 of 15

jabowabo
Mentor
Mentor

I don't see anything. Depending on the context, you may can grab the view object ID(s) and use one of the various 'send command' methods: Editor.SendCommand, Document.SendStringToExecute, Editor.CommandAsync

0 Likes
Message 3 of 15

tom.povey
Enthusiast
Enthusiast

Unfortunately the command doesn't take any arguments to specify which view you would like to update, so send command methods won't work. 

 

Do you know where i can find documentation for the COM API? I've only looked at dotnet. 

 

Cheers for looking

 

 

0 Likes
Message 4 of 15

jabowabo
Mentor
Mentor

I don't know of any other documentation. This looks promising:

Capture.PNG

You could potentially iterate the views, test for type, and update each. I don't see how to check for which views are outdated but haven't looked real close.

0 Likes
Message 5 of 15

tom.povey
Enthusiast
Enthusiast

Does look promising! Can't seem to find how to get the PlantOrthoView though, doesn't seem to inherit a View or Viewport. Maybe it's private?

0 Likes
Message 6 of 15

jabowabo
Mentor
Mentor

maybe a try/catch to open every object id in paper space as an ortho view. Once you find it, you could reverse engineer from there.

0 Likes
Message 7 of 15

tom.povey
Enthusiast
Enthusiast

No luck, can't even find anything that inherits PlantOrthoView. I've even iterated over every object in the drawing but no luck. Hopefully autodesk can get back to us with some more info!

0 Likes
Message 8 of 15

tom.povey
Enthusiast
Enthusiast

Anyone have any ideas?

0 Likes
Message 9 of 15

mobworld
Enthusiast
Enthusiast

Select the view with mouse and execute a command comtaining :

Autodesk.ProcessPower.PnP3dOrthoDrawingsUI.PlantOrthoView view = new Autodesk.ProcessPower.PnP3dOrthoDrawingsUI.PlantOrthoView(true, true);
view.updateOrthoView();

This will update the view selected.

Instead of select the view with mouse, do it using the API instead

 

0 Likes
Message 10 of 15

jomar_hipolito
Participant
Participant

Have you ever inserted using CreateOrthos()?
Do you know to specify the insertion point of viewport using Plant 3D API C#.
Thank you.

0 Likes
Message 11 of 15

jabowabo
Mentor
Mentor

@jomar_hipolito wrote:

Have you ever inserted using CreateOrthos()?
Do you know to specify the insertion point of viewport using Plant 3D API C#.
Thank you.


Sorry, I do not have any experience with this method.

Message 12 of 15

phantritech
Participant
Participant
Message 13 of 15

jomar_hipolito
Participant
Participant

thank you

0 Likes
Message 14 of 15

jomar_hipolito
Participant
Participant

hello, do you know how to select the viewport and read the blockreference inside the viewport using plant 3D API .net? thank you

 

0 Likes
Message 15 of 15

jomar_hipolito
Participant
Participant

Hello, do you know how to trigger mouse left button using AutoCAD API?
I am inserting viewport using CreateOrthos, but I need to manually click a point on the paper space to insert the viewport.

jomar_hipolito_0-1750066837105.png

On this image I need to click using mouse to insert it, or type a number then enter to insert it.
Is there a code in Plant3D API so I can trigger the left click on mouse or connect to the text screen to insert a point.
I tried using sendCommand, but it will wait for me to click or insert the viewport manually before implementing the sendCommand

0 Likes