.NET

Reply
Distinguished Contributor
HJohn1
Posts: 170
Registered: ‎09-26-2008
Message 1 of 3 (195 Views)

Setting current Layout

195 Views, 2 Replies
08-23-2013 12:33 PM

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.

 

*Expert Elite*
_gile
Posts: 2,114
Registered: ‎04-29-2006
Message 2 of 3 (191 Views)

Re : Setting current Layout

08-23-2013 12:50 PM 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
Distinguished Contributor
HJohn1
Posts: 170
Registered: ‎09-26-2008
Message 3 of 3 (158 Views)

Re : Setting current Layout

08-25-2013 09:24 AM 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.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!