.NET

Reply
Contributor
Posts: 15
Registered: ‎08-05-2008
Message 1 of 17 (276 Views)

How Do I Reverse The Effect Of AutoCadBlockReference.Visible In AutoCAD?

276 Views, 16 Replies
03-14-2013 10:06 AM

How Do I Reverse The Effect Of AutoCadBlockReference.Visible?

My question is very simple but I seem to be having quite a bit of trouble finding an answer. In code I have this:

block.Visible = false;

But I have no idea how to reverse this in AutoCAD 2012. I can't see this block anymore (makes sense) but I also can't change this seemingly unfindable "Visible" property back to true.

Moderator
Alexander.Rivilis
Posts: 1,346
Registered: ‎04-09-2008
Message 2 of 17 (230 Views)

Re: How Do I Reverse The Effect Of AutoCadBlockReference.Visible In AutoCAD?

03-15-2013 03:45 AM in reply to: tracer123

Only If you have ObjectId (or Handle) of this BlockReference you can change its visibility. But if BlockReference is invisible you can not select it on screen.


Пожалуйста не забывайте про Утвердить в качестве решения! Утвердить в качестве решения и Give Kudos!Баллы
Please remember to Accept Solution! Accept as Solution and Give Kudos!Kudos

Contributor
Posts: 15
Registered: ‎08-05-2008
Message 3 of 17 (220 Views)

Re: How Do I Reverse The Effect Of AutoCadBlockReference.Visible In AutoCAD?

03-15-2013 08:21 AM in reply to: Alexander.Rivilis

Yes I understand that I can't select it on screen. I can use something like QSELECT to select the invisible block, but how do I change it back to visible?

Valued Mentor
Posts: 379
Registered: ‎04-11-2010
Message 4 of 17 (209 Views)

Re: How Do I Reverse The Effect Of AutoCadBlockReference.Visible In AutoCAD?

03-15-2013 10:39 AM in reply to: tracer123

Hi,

 

If you set the entity visibility off by code, just set visibility on by code too, use a select all with a filter and check the visibility property of each entity.

 

Gaston Nunez

 

 

 

 

Contributor
Posts: 15
Registered: ‎08-05-2008
Message 5 of 17 (204 Views)

Re: How Do I Reverse The Effect Of AutoCadBlockReference.Visible In AutoCAD?

03-15-2013 11:25 AM in reply to: gasty1001

I know I can do it in code, but I want to be able to do it in AutoCAD directly. I find it hard to believe that the code can do something that can't be reversed in AutoCAD.

*Expert Elite*
arcticad
Posts: 1,285
Registered: ‎06-21-2004
Message 6 of 17 (201 Views)

Re: How Do I Reverse The Effect Of AutoCadBlockReference.Visible In AutoCAD?

03-15-2013 11:29 AM in reply to: tracer123

UnIsolateObjects

 

---------------------------



(defun botsbuildbots() (botsbuildbots))
Contributor
Posts: 15
Registered: ‎08-05-2008
Message 7 of 17 (198 Views)

Re: How Do I Reverse The Effect Of AutoCadBlockReference.Visible In AutoCAD?

03-15-2013 11:40 AM in reply to: arcticad

arcticad wrote:

UnIsolateObjects

 


This seems to be the closest thing - however this is the result of it:

Command: _UnIsolateObjects
No objects to unisolate.

 I know that there are 3 blocks that are hidden but doing an unisolate does not reshow them. Any thoughts?

*Expert Elite*
arcticad
Posts: 1,285
Registered: ‎06-21-2004
Message 8 of 17 (194 Views)

Re: How Do I Reverse The Effect Of AutoCadBlockReference.Visible In AutoCAD?

03-15-2013 12:05 PM in reply to: tracer123

I've run a few tests and ...

 

If an object is hidden by HideObjects or  IsolateObjects

the programs are not using the visible property to control visibility

 

the visible=true does nothing

 

If you hide the object with visible= false then

UnIsolateObjects will do nothing to turn it back on

 

AutoCAD is using something different, probably a style or dictionary that you can't see to hide and show objects.

 

 

 

 

---------------------------



(defun botsbuildbots() (botsbuildbots))
Valued Mentor
Posts: 379
Registered: ‎04-11-2010
Message 9 of 17 (185 Views)

Re: How Do I Reverse The Effect Of AutoCadBlockReference.Visible In AutoCAD?

03-15-2013 12:24 PM in reply to: tracer123

Hi,

 

Can you post a test dwg?

 

Gaston Nunez

Valued Mentor
Posts: 370
Registered: ‎05-06-2012
Message 10 of 17 (165 Views)

Re: How Do I Reverse The Effect Of AutoCadBlockReference.Visible In AutoCAD?

03-16-2013 12:40 AM in reply to: tracer123

AutoCAD doesn't provide any way to set the Visibility property of an Entity to false, so why are you expecting it to provide a way to do the opposite?

 

If you set the Visibility property through code, then it should only be reversable by your code, otherwise, the user can break an application that relies on them not being able to change something the application does not want them to change directly.

 

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Welcome to the new Autodesk Community!
If this is your first visit, click here to get started and make the most of the Community. Let us know what you think of the new experience in the Community Feedback Forum.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community