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

Hiding Entities in Viewports

8 REPLIES 8
Reply
Message 1 of 9
Anonymous
997 Views, 8 Replies

Hiding Entities in Viewports

Hi,

I need to hide entities in some viewports, but show them in others. Is
there any way of doing this WITHOUT using layers?

James.
8 REPLIES 8
Message 2 of 9
Anonymous
in reply to: Anonymous

If those are custom entities, I would say implement viewportDraw method and
there call setVisibility() although I am not sure if it is correct to call
it from viewportDraw.
Wait a minute. Why not just DO NOT draw it in the viewportDraw?

"James M" schreef in bericht
news:9F7E379716D88C7054D955F1F5EE64A3@in.WebX.maYIadrTaRb...
> Hi,
>
> I need to hide entities in some viewports, but show them in others. Is
> there any way of doing this WITHOUT using layers?
>
> James.
>
>
Message 3 of 9
Anonymous
in reply to: Anonymous

Unfortunately, they are not custom entities. I need to be able to do it for
any entity in AutoCAD.


"andru123" wrote in message
news:C5FF80463620B23B80C9020EF0CC1511@in.WebX.maYIadrTaRb...
> If those are custom entities, I would say implement viewportDraw method
and
> there call setVisibility() although I am not sure if it is correct to call
> it from viewportDraw.
> Wait a minute. Why not just DO NOT draw it in the viewportDraw?
>
> "James M" schreef in bericht
> news:9F7E379716D88C7054D955F1F5EE64A3@in.WebX.maYIadrTaRb...
> > Hi,
> >
> > I need to hide entities in some viewports, but show them in others. Is
> > there any way of doing this WITHOUT using layers?
> >
> > James.
> >
> >
>
>
Message 4 of 9
2020SPI
in reply to: Anonymous

Hi,
I would like to do exactly the same. Did you find any solution ?
Thanks
Message 5 of 9
Anonymous
in reply to: Anonymous

hi, do you have any solution?

i meet with the same problem, do need some help.

thx.

Message 6 of 9
thierry_prince
in reply to: Anonymous

Hi,

 

Take a look at the AcGiDrawableOverrule or AcDbVisibilityOverrule classes.

 

Cheers,

Thierry

Message 7 of 9
Anonymous
in reply to: thierry_prince

thx, but still have not idea how to use this two class,

I have a entity class derive from AcDb3dSolid, should I override the subSetVisibility() method?

 

Message 8 of 9
tbrammer
in reply to: Anonymous

This is on top of my wishlist since years! I'm glad to see that I'm not the only one Smiley Happy

 

The easiest way to hide an entity in a viewport is to put the entity on a layer that is invisible in this viewport. You can freeze layers in a viewport using

AcDbViewport::freezeLayersInViewport(const AcDbObjectIdArray &layerIDs);

But than you have an unwanted layer-dependency.

 

In fact the only alternative is to use custom viewportDraw()-approaches. This is possible but quite complicated, inefficient and tends to be unstable according to my experience. Since ARX supports overrules, you are no longer limited to custom objects.

 

See here for examples:

http://through-the-interface.typepad.com/through_the_interface/2015/10/displaying-different-entities...

http://adndevblog.typepad.com/autocad/2012/07/hide-entity-in-given-paper-space-viewports-using-overr...

 

IMO it should be a simple task for Autodesk to implement visibility per viewport. It already works for the layer visibility.


Thomas Brammer ● Software Developer ● imos AGLinkedIn
If an answer solves your problem please [ACCEPT SOLUTION]. Otherwise explain why not.

Message 9 of 9
Anonymous
in reply to: tbrammer

hi, tbrammer

thanks for your reply, I will try to do this in C++ today, because I'm not familiar with C#, hope it will  work.

 

thx,

nolan

 

 

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

Post to forums  

Autodesk Design & Make Report

”Boost