Announcements

Announcement: We’re aware of an issue affecting starting a new topic from category pages and creating new blog posts. New topics can still be started directly from the relevant board. Learn more here.

Run layer state in active viewport, turning off paperspace objects

Run layer state in active viewport, turning off paperspace objects

Anonymous
Not applicable
1,152 Views
5 Replies
Message 1 of 6

Run layer state in active viewport, turning off paperspace objects

Anonymous
Not applicable

Need some help. We have a drawing named "floor plan" xrefed and located in model space of our drawing "sheets" file. The "floor plan" drawing contains its own set of layer states - for floor plan, ceiling plan, etc. I have a sheet setup in the "sheets" file with a "titleblock" xrefed into paperspace and a viewport for the "floor plan" file. When I activate the viewport and run the layer state for the xrefed "floor plan" then the "titleblock" in paperspace turns off. Is there a way to run a layer state in a viewport and not affect paperspace objects?

 

Unfortunately, I cannot edit the "floor plan" layer states in the "sheets" file because the layer state editor will not allow you to edit layer states of an exerted drawing. Thanks.

0 Likes
1,153 Views
5 Replies
Replies (5)
Message 2 of 6

imadHabash
Mentor
Mentor

Hi,

>> When I activate the viewport and run the layer state for the xrefed "floor plan" then the "titleblock" in paperspace turns off.

Since you can not edit the "floor plan" layer states , i suggest to change your titleblock layer . i mean change your titleblock layer that attached on . 

 

Imad Habash

EESignature

0 Likes
Message 3 of 6

Anonymous
Not applicable

Thanks. That was one of our thoughts. When we worked in Autocad Windows there was an option to "Turn off layers not listed in later states" which resolved this issue, however I do not see this is an option in the Mac version. Ultimately to do as you suggest we would need to edit the layer states for each new project, which is doable, just not as convenient.

0 Likes
Message 4 of 6

cadffm
Consultant
Consultant

If you asked for AutoCAD for MAC, you are in the wrong board..

 

 

And: You are right. I am not a MAC User, but what i can read from the MAC help, it isn't an option for AutoCAD for MAC.

 

-

But there should be a Lispfunction to do that (and as last option, it's possible to wrote one).

 

We can run a short test if you like, but i am not the one who wrote whole programs for others

Sebastian

0 Likes
Message 5 of 6

cadffm
Consultant
Consultant

@cadffm wrote:

@Anonymous 

But there should be a Lispfunction to do that (and as last option, it's possible to wrote one).

We can run a short test if you like, but i am not the one who wrote whole programs for others


Copy this line to text EDITOR

(layerstate-restore "[XREFNAME]__[LAYERNAME]" (ssname (ssget "_X" (list'(0 . "VIEWPORT")(cons 69 (getvar 'CVPORT)))) 0) 4)

 

Open your main file

 

Edit: Change the red part to the XRef layer state name

For example, My XRefname is TEST and the layer state name is 123,

in your main file the XRef layer state name is: TEST__123

right?

OK:

(layerstate-restore "TEST__123" (ssname (ssget "_X" (list'(0 . "VIEWPORT")(cons 69 (getvar 'CVPORT))(cons 410 (getvar 'CTAB)))) 0) 4)

Copy to clipboard your edited line [CTRL]+[c]

Go into your viewport, paste your line [CTRL]+[V]

and?

 

 

Sebastian

Message 6 of 6

brandon2WL3W
Community Visitor
Community Visitor

Same person...just different account...

 

Thanks for sending this, but I think we have found a work around where we will name all of our titleblocks (and associated titleblock layers) the same on every project and then just edit the layer states in our drawing template file. Appreciate the help.

0 Likes