.NET

.NET

Reply
Contributor
15 Posts
0 Kudos
Registered: ‎08-05-2008
Post 1 of 17

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

294 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
1,465 Posts
277 Kudos
Registered: ‎04-09-2008
Post 2 of 17

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
15 Posts
0 Kudos
Registered: ‎08-05-2008
Post 3 of 17

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?

Distinguished Mentor
582 Posts
91 Kudos
Registered: ‎04-11-2010
Post 4 of 17

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
15 Posts
0 Kudos
Registered: ‎08-05-2008
Post 5 of 17

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*
1,286 Posts
37 Kudos
Registered: ‎06-21-2004
Post 6 of 17

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
15 Posts
0 Kudos
Registered: ‎08-05-2008
Post 7 of 17

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*
1,286 Posts
37 Kudos
Registered: ‎06-21-2004
Post 8 of 17

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))
Distinguished Mentor
582 Posts
91 Kudos
Registered: ‎04-11-2010
Post 9 of 17

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
370 Posts
175 Kudos
Registered: ‎05-06-2012
Post 10 of 17

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.

 

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!