Block ename inside block editor

Block ename inside block editor

msarqui
Collaborator Collaborator
1,018 Views
7 Replies
Message 1 of 8

Block ename inside block editor

msarqui
Collaborator
Collaborator

Hi guys

 

This is not ease to me to explain, but I will try and I hope someone understands.


Is it possible to have the block's entity name in its BEdit-Session (BLOCKEDITOR = 1).
For example:
With (setq ename (car (entsel))) I am able to get the entity name of a selected block. Let's call it "Block A".
Now, let's say I am in the block editor of the "Block A". So, how can I do the same and get its entity name if I can't select it anymore?

 

Thanks in advance.

p.s. "Block A" was used only to clarify my question, I don't really know its name. It could be any one.

0 Likes
1,019 Views
7 Replies
Replies (7)
Message 2 of 8

Kent1Cooper
Consultant
Consultant

I don't think you can do what you're asking.  The Block Editor is editing the definition  of the Block, but an entity name belongs only to a specific insertion  [reference] of that Block definition.  In the Block Editor, you are not "working on" an insertion of it, so there is no entity name available for the Block as a whole, only for the pieces that make up its definition.  Think about it -- if "Block A" is Inserted twenty times in the drawing, which entity name [that is, the entity name of which of those twenty insertions ] would you want, when you're editing the definition that applies to all  of them?

 

[I'm curious as to what you would intend to do  with such an entity name if you could get it.]

Kent Cooper, AIA
Message 3 of 8

cadffm
Consultant
Consultant

@Kent1Cooper
I think he want to know the Blockname of current open Block in Blockeditor.

The last three threads had the content: Working with Lispstatements inside Bedit.

@msarqui
There is no variable like for REFEDIT command is present.
One thread more where i like to say: I can not believe thats the way to go.
and i mean using Lisp inside BEdit.
But without the knowledge what the state today and what is the final goal, we can do nothing (help to find smarter ways).

If you read and learn to understand my previous code you see the workaround,
there was need to know the current-edit-blockname.

Not smart, not well, only a possible workaround.

Sebastian

0 Likes
Message 4 of 8

Kent1Cooper
Consultant
Consultant

@cadffm wrote:

.... I think he want to know the Blockname of current open Block in Blockeditor. ....


Perhaps -- if so, "ename" and "entity name" are the wrong terminology.

Kent Cooper, AIA
Message 5 of 8

cadffm
Consultant
Consultant

ha,

i read it a second and third time and now i am sure you are right.

Kudos for your glass sphere.


Ename of selected block(reference), but you can edit a Blockdefinition without selecting a blockreference...

(Undepend from the question 'why?' he want a ename of a blockreference in this situation / strange)

Sebastian

0 Likes
Message 6 of 8

msarqui
Collaborator
Collaborator

Hi guys,

 

My goal is... get the current visibility state name.

Capture.JPG

 

I know that I can (and how to) get the visibility state name outside the Block Editor with the entity name of the block. That's why I asked for entity name, to try to do the same in the Block Editor.

In my other post, Sebastian already helped me to get the current visibility's list, but that was only a part of the code I am working. I tried to study/adapt Sebastian's code to get the entity name, but without success.

 

In short:
In the office where I work, all the blocks have the same visibilities. The code I'm working creates them automatically and after that, depending on what visibility I set current, it does the BHIDE on specific objects with the help of SSGET and filters. At this moment, after I set the visibility, I need to "manually" chose the SSGET filter from an INITGET list. So, if I could put the current visibility to a variable, I would be able to automate 100% of the process. It may be confusing to put into words, but right now the code is working pretty well and it is saving me hours and hours. Get the current visibility name will be the last part of that.

 

I think Kent has an excellent point. Being in the block editor, I am not selecting the instance of the block, but is "matrix". So, if this is not possible, at least I can get over it and go to the next step. 🙂

 

 

 

0 Likes
Message 7 of 8

cadffm
Consultant
Consultant

Oh, that is something completely different again as expected.

Without looking closer: The information "current state" in BEdit is temporary without effect for the block-object.

It's just a temporary situation when edit the block.
I think with Lisp you will not get there - or you have to search a lot - if you have hope.

 

 

So, ad hoc I don't know a positive answer, but if its a help for you:

You can controle VisibilityState by command  _.-BVSTATE, if you set a VisibilityState as current -> NOW you know the name of the current VisibilityState.

 

tss

 

Sebastian

Message 8 of 8

msarqui
Collaborator
Collaborator
This is a good idea.
I will try.
0 Likes