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

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

16 REPLIES 16
Reply
Message 1 of 17
tracer123
719 Views, 16 Replies

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

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.

16 REPLIES 16
Message 2 of 17

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.

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

Message 3 of 17

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?

Message 4 of 17
hgasty1001
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

 

 

 

 

Message 5 of 17
tracer123
in reply to: hgasty1001

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.

Message 6 of 17
arcticad
in reply to: tracer123

UnIsolateObjects

 

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



(defun botsbuildbots() (botsbuildbots))
Message 7 of 17
tracer123
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?

Message 8 of 17
arcticad
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))
Message 9 of 17
hgasty1001
in reply to: tracer123

Hi,

 

Can you post a test dwg?

 

Gaston Nunez

Message 10 of 17

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.

 

Message 11 of 17


@DiningPhilosopher wrote:

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?

 


I don't know if this statement is true. Not only that, but just because the code labels it 'Visibility' doesn't mean it will be called that in AutoCAD. Can you please provide some type of source so that I know this is a true statement?

 


@DiningPhilosopher wrote:

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.


 

By that logic, if I change a block name from code, no one should be able to change that block name in AutoCAD. They could 'break' an application that depends on a block with a specific name being there.

 

Message 12 of 17

There is no instruments in "pure" AutoCAD (i.e. without any additional lisp/vba/arx/.net applications) to set visibility of entity to On or Off. IMHO all the other conversations on this topic does not make sense. What is the question?

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

Message 13 of 17

Sorry, what you are suggesting makes no sense.

 

There are countless things that can be done via the API that cannot be done directly by a user with the standard out-of-the box software. The API goes way beyond what is generally regarded as 'UI Automation', which means automating things that can be done with the UI, and which simple folk simply call 'scripting'.

 

The ObjectARX API is not merely for scripting.

 

Regarding your request, you're the one making a presumption that is incorrect. If you can show a case where Visibility is used directly on objects (verses indirectly via functions like Dynamic Block Visibility states), the ball is in your court.

 

Message 14 of 17


@tracer123 wrote:

 

By that logic, if I change a block name from code, no one should be able to change that block name in AutoCAD. They could 'break' an application that depends on a block with a specific name being there.

 


 

Anonymous blocks exist to solve that very problem.  

 

Applications can create and use them without having to worry about them being renamed by the user.

 

Assuming you know what an anonymous block is, can you find a way to rename one ?

 

 

Message 15 of 17

DiningPhilosopher, your pretentious attitude is insulting. I've no intention of furthering a conversation with you by answering your off-topic questions.

 

 

 

This topic has digressed; for anyone else, the answer is that you can't, case closed.

Message 16 of 17


@tracer123 wrote:

I've no intention of furthering a conversation with you by answering your off-topic questions.


There's nothing off-topic about my question. 

 

Perhaps you are confusing your own unfamiliarity with AutoCAD and its APIs with what you misperceive as being 'off-topic'.  If you were at all familiar with AutoCAD you wouldn't have had to ask this group to explain to you, the difference between an Attribute and an AttributeReference.

 

Name-calling isn't the best way to go about acknowledging fault or that your presumptions are entirely wrong, but if that's your cup of tea, then by all means, go for it. .

 

 

 

 

Message 17 of 17
jeff
in reply to: tracer123


tracer123 wrote:

DiningPhilosopher wrote:

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?

 


I don't know if this statement is true. Not only that, but just because the code labels it 'Visibility' doesn't mean it will be called that in AutoCAD. Can you please provide some type of source so that I know this is a true statement?

 

 

Hi,

You can look at message 10 here

 

 

 

 

You can also find your answers @ TheSwamp

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