.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Setting current Layout

2 REPLIES 2
Reply
Message 1 of 3
HJohn1
419 Views, 2 Replies

Setting current Layout

Something estrange happened.  After setting a layout for printing current,

 

LayoutManager.Current.CurrentLayout = LayoutName

 

btblRec = CType(tr.GetObject(db.CurrentSpaceId, OpenMode.ForWrite), BlockTableRecord)

 db.CurrentSpaceId returned the ObjectID of the ModelSpace and not of the Layout set current.  Have anybody seen this happening?  Is there something that could prevent this from happening?  Thanks for any help.

 

2 REPLIES 2
Message 2 of 3
_gile
in reply to: HJohn1

Hi,

 

Isn't there an active floating viewport in the layout ? If so, this is normal, the active space is the floating viewport model space.

You can switch to paper space using the Editor.SwitchToPaperSpace() method.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

Message 3 of 3
HJohn1
in reply to: _gile

Thank you Gille I will do that.  Are you saying that by setting the CurrentLayout one just sets a Layout current, but that Editor will continue be on ModelSpace, if it was in ModelSpace when the Layout was set current until one calls the SwitchToPaperSpace method?  Therefore, db.CurrentSpaceId returns the ObjectId of the ModelSapce.

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost