How to move a drawing view between sheets

How to move a drawing view between sheets

davidt162003
Advocate Advocate
2,079 Views
7 Replies
Message 1 of 8

How to move a drawing view between sheets

davidt162003
Advocate
Advocate

so i want to create a view like this 

davidt162003_0-1709208629478.png

theirs a break view and its also been cropped, however i cant do it like this in inventor.

 

so what i was going to do was either create a break view and then use break out to get rid  of the sections i dont want or 

use a detail view and then move it onto a second sheet which is my preferred method.

 

I know using the UI you can drag a detail view from one sheet to another using the design tree. 

So i was wondering if their was a way to do this using the API? 

HII
0 Likes
2,080 Views
7 Replies
Replies (7)
Message 2 of 8

WCrihfield
Mentor
Mentor

Hi @davidt162003.  Yes, the DrawingView object has a method named MoveTo that we can use to move an existing DrawingView object from its current sheet to another sheet.  There is also a similar method called CopyTo for copying a DrawingView from one sheet to another.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 8

gkniksch_aep
Contributor
Contributor

Is there a method or other recommended technique that allows copying groups of drawing views at the same time so, for example, projected views stay linked and aligned with their parent views? Thanks in advance.

0 Likes
Message 4 of 8

gkniksch_aep
Contributor
Contributor

@Tiffany_Hayden_ FYI 😊

Message 5 of 8

WCrihfield
Mentor
Mentor

Hi @gkniksch_aep.  I don't know of a 'built-in' method specifically for copying multiple drawing views at once, but there is a built-in method for copying a whole Sheet (Sheet.CopyTo).  That method is designed for copying that Sheet into another drawing document though, not for copying it within the same drawing document.  I have seen some folks create another temporary drawing, copy the sheet to it, then copy it back into the current drawing, but that is pretty inefficient and comes with a whole new set of problems.  I did create a custom method for copying one or more sheets within the same drawing document though, and the sheet can contain the views you are wanting to copy.  If I am remembering correctly, that custom method had some restrictions though, such as that drawing needed to be the 'active' document, and something about when parent / child views were on different sheets, then it would not work properly.  We could likely create a custom code routine for copying multiple views at the same time though, which would likely work similarly to how that custom method worked, using the Clipboard system where the source object(s) are selected, then executing commands that simulate the 'Copy & Paste' behavior.  That system is not accurate about where the new copies would be located though, because it is very basic, and is unlike other Inventor API type code routines.

 

Could you maybe provide more details about what you are wanting/trying to do?

  • Are you wanting to copy the views from a sheet to a different location on the same sheet?
  • Are you wanting to copy the views to another sheet within the same drawing document?
    • Does the other sheet already exist, or does the other sheet need to be created?
  • Are you wanting to copy the views to another drawing document?
    • Does the other drawing document already exist, or does it need to be created?
    • What sheet on the other drawing should they be copied to?
  • Where should the new views be located, and now do you plan on specifying that location?
  • Also, why do you want to copy the existing views instead of create new ones?

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 6 of 8

gkniksch_aep
Contributor
Contributor

Good call - I thought about using the clipboard because that's working manually. However, in this case, it appears I'm able to accomplish the same effective result by just realigning the views after copying them over individually. The browser relationship changes, but I can still communicate the same info on the drawing and that's all the end user is concerned with.

 

Here is the situation. I have a drawing automation system set up to detail drawing sets for standard structures. It starts with a template drawing and wipes out all the sheets to start from fresh sheets. Many of these structures don't require this extra detail added to the drawing, but in a few cases, there is an extra plate (with holes) detail that needs to be added alongside another view (located relative to that view). This detail has a front and top view and it's static - the design never changes. Because it's a detail I don't often need, I'm storing it in a separate template drawing that I'll open in the background to copy the detail from when needed.

 

I could do what you're suggesting with copying the sheet over and then proceeding with the remaining automation on that sheet, but that adds more complication to the flow of the logic than it's worth (in this case). If I absolutely needed that browser relationship maintained, I'd go that route. And I still might if requirements change.

 

I'll try to get on the idea board and suggest this method be added.

 

Thanks for your response!

0 Likes
Message 7 of 8

WCrihfield
Mentor
Mentor

Another quick thought that comes to mind after reading that is using a SheetFormat.  We can use Sheets.AddUsingSheetFormat to add a Sheet that can already contain: a border, a title block, other annotations (that are not directly connected to a view), and views, then dictate which source model will populate its views, and specify other such settings.  I don't think using that will preserve actual dimensions and leader text that were directly attached to geometry within the views though, which may be a deal braker.  We can also create new SheetFormat objects by code, on the fly, if needed, then delete them when done.

DrawingDocument.SheetFormats 

SheetFormats.Add 

SheetFormats.AddWithOptions

SheetFormat.Delete  

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 8 of 8

gkniksch_aep
Contributor
Contributor

That sounds pretty cool. I did not realize there was an option to auto-scale the views to the sheet. I currently have auto-scaling built into the automation, but it sounds like it takes more into account so I probably wouldn't be able to replace the current logic with a SheetFormat. I consider the border, title block, parts list, and surrounding sketch symbols. And yeah, adding views of the plate detail without the dimensioning would be a deal breaker. It's not worth automating dimensions for a static view.

I'll have to play around with the SheetFormats sometime.

 

Thanks again!

0 Likes