Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Copy Section View

3 REPLIES 3
Reply
Message 1 of 4
Anonymous
746 Views, 3 Replies

Copy Section View

Is it possible to copy a section or detail view?

I have tried this code without success.

Call oDrawingView.CopyTo(oTargetIDW.ActiveSheet)

Thanks Malcolm
3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: Anonymous

I'm afraid the CopyTo method won't work in these cases since section, detail
and certain other views require that the base view be copied over as well.

The workaround is to simulate the UI workflow via the API (by driving the
copy/paste commands). Sample below:

Sub CopyViews()

Dim oDoc As DrawingDocument
Set oDoc = ThisApplication.ActiveDocument

oDoc.SelectSet.Clear

' Select all drawing views
Dim oView As DrawingView
For Each oView In oDoc.ActiveSheet.DrawingViews
oDoc.SelectSet.Select oView
Next

Dim oCopyCmd As ControlDefinition
Set oCopyCmd =
ThisApplication.CommandManager.ControlDefinitions.Item("AppCopyCmd")

oCopyCmd.Execute

oDoc.SelectSet.Clear

Dim oTargetDoc As DrawingDocument
Set oTargetDoc = ThisApplication.Documents.Item(3)

oTargetDoc.Activate

Dim oPasteCmd As ControlDefinition
Set oPasteCmd =
ThisApplication.CommandManager.ControlDefinitions.Item("AppPasteCmd")

oPasteCmd.Execute

End Sub

Sanjay-

wrote in message news:5668188@discussion.autodesk.com...
Is it possible to copy a section or detail view?

I have tried this code without success.

Call oDrawingView.CopyTo(oTargetIDW.ActiveSheet)

Thanks Malcolm
Message 3 of 4
barryncowley
in reply to: Anonymous

Simplest method I have found is to make a "Detail View" of the section and edit the 'detail' in the title to 'section-a'.
I use this method when I want to show only a scrap of the section instead of the full section. What I usually do is to place the section outside the sheet area and detail only the scrap I want to show.

Hope this helps

Regards
Barry
Message 4 of 4
ralfmja
in reply to: Anonymous

Hello,

I've a question about your method 😛 I know this is old post etc. ,but for me your method is excellent.

Ok, I want to copy (in the same way) hole tables and part lists,which merge with my drawing ?? Is it possible to do that and of course how can I do that ....

thanks for reply

regards
ralfmj

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report