Author Topic: change active layout in autocad R14  (Read 9322 times)

0 Members and 1 Guest are viewing this topic.

yaque

  • Guest
change active layout in autocad R14
« on: October 22, 2010, 04:23:03 PM »
I have a challenge for you good people.
My office is (until recently)  exclusively Autocad R14. That means no Visual Lisp!
(I know, you can laugh, It's okay  :-)  )

We intend to transfer to Bricscad Pro.
(I want immediately, my bosses would drag it out over years  :cry: )
So, at least for a while, we'll have both.
Files would be saveas R14, that works okay.

But I would like to start using multiple layouts.
Autocad R14 and vanilla lisp can access and manipulate dictionaries,
and layouts live in dictionaries someplace.
So I could likely work out a lisp, that when the R14 user switches to paperspace,
a prompt asks the user which layout, and sets the "active" layout accordingly before switching.

I don't like to reinvent the wheel, does something like this already exist?
or a lisp fragment showing how to change the "active" layout without visual lisp?

I'm aware that this is from the stone age, sorry  :oops: .

T.Willey

  • Needs a day job
  • Posts: 5251
Re: change active layout in autocad R14
« Reply #1 on: October 22, 2010, 04:35:20 PM »
The system variable ' ctab ' will let you change the current tab ( layout ).
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: change active layout in autocad R14
« Reply #2 on: October 22, 2010, 04:37:20 PM »
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: change active layout in autocad R14
« Reply #3 on: October 22, 2010, 04:40:41 PM »
I know I'm going to hell but I laughed hard.  :-D
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

yaque

  • Guest
Re: change active layout in autocad R14
« Reply #4 on: October 22, 2010, 04:56:33 PM »
That's my problem, "ctab" is a variable in Autocad 2000 and up, not in Autocad R14  :cry:
When opening a drawing from A2000 and up in Acad14, the last edited layout is opened, and the others are not accessible
in Acad14.

So I have to go into the dictionaries with plain lisp, get the list of layout names,
and set one of them as being the "last edited" layout, so that the Acad14 user can get to it when going to "paperspace".
I know, awkward  :? .

My real question is, how is the "last edited" layout stored? in a dictionary?
How does Autocad remember which layout to switch to when "tilemode" is set to "0"?
 

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: change active layout in autocad R14
« Reply #5 on: October 22, 2010, 04:59:30 PM »
Code: [Select]
(command "_.layout" "_set"....)
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

yaque

  • Guest
Re: change active layout in autocad R14
« Reply #6 on: October 22, 2010, 05:04:23 PM »
alanjit:
    :-D
I know, you're right, but my boss hates the Autodesk treadmill, and for most purposes, R14 is adequate.
I'm trying to persuade him to get on the Bricscad treadmill (version 11 just came out)
which is a lot more bearable.

And I like Bcad. 8-)

yaque

  • Guest
Re: change active layout in autocad R14
« Reply #7 on: October 22, 2010, 05:05:13 PM »
Sorry, "layout" isn't a command in Autocad R14 either  :-(

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: change active layout in autocad R14
« Reply #8 on: October 22, 2010, 05:11:10 PM »
That's my problem, "ctab" is a variable in Autocad 2000 and up, not in Autocad R14  :cry:
When opening a drawing from A2000 and up in Acad14, the last edited layout is opened, and the others are not accessible
in Acad14.

So I have to go into the dictionaries with plain lisp, get the list of layout names,
and set one of them as being the "last edited" layout, so that the Acad14 user can get to it when going to "paperspace".
I know, awkward  :? .

My real question is, how is the "last edited" layout stored? in a dictionary?
How does Autocad remember which layout to switch to when "tilemode" is set to "0"?
 
r14 didn't have layouts. It only had Paper and Model. If I remember correctly, if the drawing is saved (from newer to r14) and has multiple layouts, the active layout (if a paperspace one) will become Paperspace and the rest are lost. Am I way off? It's been a while since I had to deal with that.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

yaque

  • Guest
Re: change active layout in autocad R14
« Reply #9 on: October 22, 2010, 05:16:38 PM »
No, they aren't lost. They survive the round trip okay, It's just that Acad14 can't normally get to them.

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: change active layout in autocad R14
« Reply #10 on: October 22, 2010, 05:18:03 PM »
No, they aren't lost. They survive the round trip okay, It's just that Acad14 can't normally get to them.
Hmph, interesting.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

T.Willey

  • Needs a day job
  • Posts: 5251
Re: change active layout in autocad R14
« Reply #11 on: October 22, 2010, 05:19:03 PM »
I wouldn't even know where to start looking.  The layout are in a dictionary within the named object dictionary.

Command: (PEDATA (dictsearch (namedobjdict) "ACAD_LAYOUT"))

(-1 . <Entity name: -4af8d330>)
(0 . "DICTIONARY")
(5 . "1A")
(102 . "{ACAD_REACTORS")
(330 . <Entity name: -4af8d3a0>)
(102 . "}")
(330 . <Entity name: -4af8d3a0>)
(100 . "AcDbDictionary")
(280 . 0)
(281 . 1)
(3 . "Layout1")
(350 . <Entity name: -4af8d2b8>)
(3 . "Layout2")
(350 . <Entity name: -4af8d290>)
(3 . "Model")
(350 . <Entity name: -4af8d2f0>)

Maybe that helps.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: change active layout in autocad R14
« Reply #12 on: October 22, 2010, 05:21:04 PM »
I'm curious how you are going to see them with r14 CAD (relying on you having found the objects in a dictionary or something). Multiple sheets in r14 consisted of lots of viewports in the one and only paperspace.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

T.Willey

  • Needs a day job
  • Posts: 5251
Re: change active layout in autocad R14
« Reply #13 on: October 22, 2010, 05:24:07 PM »
Maybe it can only read the first layout.  Not sure how that would be told unless by handles, or it just knows the last active layout, and keeps that one, as the one R14 should see.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

yaque

  • Guest
Re: change active layout in autocad R14
« Reply #14 on: October 22, 2010, 05:39:33 PM »
Right,
(dictsearch (namedobjdict) "ACAD_LAYOUT")
returns
((-1 . <Entity name: 4671c18>)
  (0 . "DICTIONARY")
  (5 . "DF50B")
  (102 .  "{ACAD_XDICTIONARY")
  (360 . <Entity name: 4750510>)
  (102 . "}")
  (102 . "{ACAD_REACTORS")
  (330 . <Entity name: 3820460>)
  (102 . "}")
  (100 . "AcDbDictionary")
  (280 . 0)
  (3 . "B")
  (350 . <Entity name: 4671c30>)
  (3 . "MODEL")
  (350 . <Entity name: 4671c28>)
  (3 . "P")
  (350 . <Entity name: 47015f8>)
)
  in an Autocad R14 session in a file with two layouts named "P" and "B".
So, when "tilemode" is set to "0", Autocad R14 goes to layout "P"

When I save the file with layout "B" as the "active" layout I get

((-1 . <Entity name: 4651c18>)
 (0 . "DICTIONARY")
 (5 . "DF50B")
 (102 . "{ACAD_XDICTIONARY")
 (360 . <Entity name: 4730530>)
 (102 . "}")
 (102 . "{ACAD_REACTORS")
 (330 . <Entity name: 45d0460>)
 (102 . "}")
 (100 . "AcDbDictionary")
 (280 . 0)
 (3 . "B")
 (350 . <Entity name: 4651c30>)
 (3 . "MODEL")
 (350 . <Entity name: 4651c28>)
 (3 . "P")
 (350 . <Entity name: 46e15f8>)
)
and when "tilemode" is set to "0", Autocad R14 goes to layout "B"


Damn they look the same, I think?