Inserting a block in a different view


#1

From model space, I am inserting a block like so.

thisDoc.Views.ActiveView = pageView(0)
partViewBOMBlock = rs.InsertBlock("PartViewTriplePlyBOM", pvPCoor)
rs.SelectObject(partViewBOMBlock)
rs.Command("_Explode")
rs.UnselectAllObjects()

But, I don’t want to switch from model space, to the view, and back again.

Is there any way to insert a block into a view without switching to it?


(Steve Baer) #2

Not for layouts, sorry. Adding of geometry to the document takes the active view in consideration to determine where the geometry ‘exists’.


#3

I think I’ll just build an internal array, and then insert everything later.

Thanks for the reply!


#4

@stevebaer

How do you switch BACK to model space?

model space is not in the list of PageViews()


(Steve Baer) #5
previous_view = thisDoc.Views.ActiveView
...
thisDoc.Views.ActiveView = previous_view

#6

Not enough coffee in my clearly lol

Thanks :slight_smile: