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.
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
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?
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
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.
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.
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.
@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.
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
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.
@Anonymous 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 ?
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.
@Anonymous 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. .
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
Can't find what you're looking for? Ask the community or share your knowledge.