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

how to find if a layer is frozen in current viewport

9 REPLIES 9
Reply
Message 1 of 10
Anonymous
390 Views, 9 Replies

how to find if a layer is frozen in current viewport

I am doing a prog that lets you know if a layer is frozen in the current viewport.
Lets assume my cursor is in a paperspace viewport, and I know the exact layer I want to test, how would I do that?

I ran my code to grab the layer object, and did a watch on it. There is no "frozen in cur vp" property, so it must be
tucked in the viewport object. I have not figured out how to grab the vport object I am in, that will likely be the key
to this.

This will be important in 2008 as it remembers lots of things per viewport.
thx
James Maeding
Civil Engineer and Programmer
jmaeding - at - hunsaker - dotcom
9 REPLIES 9
Message 2 of 10
Anonymous
in reply to: Anonymous

This is stored via xdata with the floating viewport. Check code 1003.

"James Maeding" wrote in message
news:5500239@discussion.autodesk.com...
I am doing a prog that lets you know if a layer is frozen in the current
viewport.
Lets assume my cursor is in a paperspace viewport, and I know the exact
layer I want to test, how would I do that?

I ran my code to grab the layer object, and did a watch on it. There is no
"frozen in cur vp" property, so it must be
tucked in the viewport object. I have not figured out how to grab the vport
object I am in, that will likely be the key
to this.

This will be important in 2008 as it remembers lots of things per viewport.
thx
James Maeding
Civil Engineer and Programmer
jmaeding - at - hunsaker - dotcom
Message 3 of 10
Anonymous
in reply to: Anonymous

Opps missed the getting the viewport part. Try...
Autodesk.AutoCAD.EditorInput.Editor.CurrentViewportObjectId

"James Maeding" wrote in message
news:5500239@discussion.autodesk.com...
I am doing a prog that lets you know if a layer is frozen in the current
viewport.
Lets assume my cursor is in a paperspace viewport, and I know the exact
layer I want to test, how would I do that?

I ran my code to grab the layer object, and did a watch on it. There is no
"frozen in cur vp" property, so it must be
tucked in the viewport object. I have not figured out how to grab the vport
object I am in, that will likely be the key
to this.

This will be important in 2008 as it remembers lots of things per viewport.
thx
James Maeding
Civil Engineer and Programmer
jmaeding - at - hunsaker - dotcom
Message 4 of 10
Anonymous
in reply to: Anonymous

cool, too easy 🙂

Paul Richardson
|>Opps missed the getting the viewport part. Try...
|>Autodesk.AutoCAD.EditorInput.Editor.CurrentViewportObjectId
|>
|>"James Maeding" wrote in message
|>news:5500239@discussion.autodesk.com...
|>I am doing a prog that lets you know if a layer is frozen in the current
|>viewport.
|>Lets assume my cursor is in a paperspace viewport, and I know the exact
|>layer I want to test, how would I do that?
|>
|>I ran my code to grab the layer object, and did a watch on it. There is no
|>"frozen in cur vp" property, so it must be
|>tucked in the viewport object. I have not figured out how to grab the vport
|>object I am in, that will likely be the key
|>to this.
|>
|>This will be important in 2008 as it remembers lots of things per viewport.
|>thx
|>James Maeding
|>Civil Engineer and Programmer
|>jmaeding - at - hunsaker - dotcom
James Maeding
Civil Engineer and Programmer
jmaeding - at - hunsaker - dotcom
Message 5 of 10
Anonymous
in reply to: Anonymous

"Paul Richardson" wrote:

>> Opps missed the getting the viewport part.

Double oops.....

Viewport class:

public bool IsLayerFrozenInViewport(ObjectId layerId);


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

"Paul Richardson" wrote in message news:5500510@discussion.autodesk.com...
Opps missed the getting the viewport part. Try...
Autodesk.AutoCAD.EditorInput.Editor.CurrentViewportObjectId

"James Maeding" wrote in message
news:5500239@discussion.autodesk.com...
I am doing a prog that lets you know if a layer is frozen in the current
viewport.
Lets assume my cursor is in a paperspace viewport, and I know the exact
layer I want to test, how would I do that?

I ran my code to grab the layer object, and did a watch on it. There is no
"frozen in cur vp" property, so it must be
tucked in the viewport object. I have not figured out how to grab the vport
object I am in, that will likely be the key
to this.

This will be important in 2008 as it remembers lots of things per viewport.
thx
James Maeding
Civil Engineer and Programmer
jmaeding - at - hunsaker - dotcom
Message 6 of 10
Anonymous
in reply to: Anonymous

I'm doing this wrong, this does not work:
Dim vpID As ObjectId = Autodesk.AutoCAD.EditorInput.Editor.CurrentViewportObjectId

I get an error about a non-shared member...I ran into this before but forget the answer...

Paul Richardson
|>Opps missed the getting the viewport part. Try...
|>Autodesk.AutoCAD.EditorInput.Editor.CurrentViewportObjectId
|>
|>"James Maeding" wrote in message
|>news:5500239@discussion.autodesk.com...
|>I am doing a prog that lets you know if a layer is frozen in the current
|>viewport.
|>Lets assume my cursor is in a paperspace viewport, and I know the exact
|>layer I want to test, how would I do that?
|>
|>I ran my code to grab the layer object, and did a watch on it. There is no
|>"frozen in cur vp" property, so it must be
|>tucked in the viewport object. I have not figured out how to grab the vport
|>object I am in, that will likely be the key
|>to this.
|>
|>This will be important in 2008 as it remembers lots of things per viewport.
|>thx
|>James Maeding
|>Civil Engineer and Programmer
|>jmaeding - at - hunsaker - dotcom
James Maeding
Civil Engineer and Programmer
jmaeding - at - hunsaker - dotcom
Message 7 of 10
Anonymous
in reply to: Anonymous

cool. I'm still stuck on getting the stupid viewport. I learn a lot though when the obvious stuff does not work...

Tony Tanzillo
|>"Paul Richardson" wrote:
|>
|>>> Opps missed the getting the viewport part.
|>
|>Double oops.....
|>
|>Viewport class:
|>
|> public bool IsLayerFrozenInViewport(ObjectId layerId);
James Maeding
Civil Engineer and Programmer
jmaeding - at - hunsaker - dotcom
Message 8 of 10
Anonymous
in reply to: Anonymous

Of course it doesn't.

But the reason is because you're trying to run
before you've learned to crawl.

Each open document has its own Editor object.

Study the object model, and whatever samples you
can find, including the API labs. Most of them use
the Editor class. Look at them, and see how the
Editor object for a document is obtained.

No, I'm not going to show you because you are being
lazy by not taking the effort to study the samples that
are available to you, many of which use the Editor
object, and show exactly how to get it.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

"James Maeding" wrote in message news:5500866@discussion.autodesk.com...
I'm doing this wrong, this does not work:
Dim vpID As ObjectId = Autodesk.AutoCAD.EditorInput.Editor.CurrentViewportObjectId

I get an error about a non-shared member...I ran into this before but forget the answer...

Paul Richardson
|>Opps missed the getting the viewport part. Try...
|>Autodesk.AutoCAD.EditorInput.Editor.CurrentViewportObjectId
|>
|>"James Maeding" wrote in message
|>news:5500239@discussion.autodesk.com...
|>I am doing a prog that lets you know if a layer is frozen in the current
|>viewport.
|>Lets assume my cursor is in a paperspace viewport, and I know the exact
|>layer I want to test, how would I do that?
|>
|>I ran my code to grab the layer object, and did a watch on it. There is no
|>"frozen in cur vp" property, so it must be
|>tucked in the viewport object. I have not figured out how to grab the vport
|>object I am in, that will likely be the key
|>to this.
|>
|>This will be important in 2008 as it remembers lots of things per viewport.
|>thx
|>James Maeding
|>Civil Engineer and Programmer
|>jmaeding - at - hunsaker - dotcom
James Maeding
Civil Engineer and Programmer
jmaeding - at - hunsaker - dotcom
Message 9 of 10
Anonymous
in reply to: Anonymous

you're right, I'm forgetting the basics, thx

Tony Tanzillo
|>Of course it doesn't.
|>
|>But the reason is because you're trying to run
|>before you've learned to crawl.
|>
|>Each open document has its own Editor object.
|>
|>Study the object model, and whatever samples you
|>can find, including the API labs. Most of them use
|>the Editor class. Look at them, and see how the
|>Editor object for a document is obtained.
|>
|>No, I'm not going to show you because you are being
|>lazy by not taking the effort to study the samples that
|>are available to you, many of which use the Editor
|>object, and show exactly how to get it.
James Maeding
Civil Engineer and Programmer
jmaeding - at - hunsaker - dotcom
Message 10 of 10
Anonymous
in reply to: Anonymous

That one wasn't an oops - but ignorance. Thanks for benefit of the doubt
though...~)

"Tony Tanzillo" wrote in message
news:5500849@discussion.autodesk.com...
"Paul Richardson" wrote:

>> Opps missed the getting the viewport part.

Double oops.....

Viewport class:

public bool IsLayerFrozenInViewport(ObjectId layerId);


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

"Paul Richardson" wrote in message
news:5500510@discussion.autodesk.com...
Opps missed the getting the viewport part. Try...
Autodesk.AutoCAD.EditorInput.Editor.CurrentViewportObjectId

"James Maeding" wrote in message
news:5500239@discussion.autodesk.com...
I am doing a prog that lets you know if a layer is frozen in the current
viewport.
Lets assume my cursor is in a paperspace viewport, and I know the exact
layer I want to test, how would I do that?

I ran my code to grab the layer object, and did a watch on it. There is no
"frozen in cur vp" property, so it must be
tucked in the viewport object. I have not figured out how to grab the vport
object I am in, that will likely be the key
to this.

This will be important in 2008 as it remembers lots of things per viewport.
thx
James Maeding
Civil Engineer and Programmer
jmaeding - at - hunsaker - dotcom

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