Sorry for my english
I am looking to obtain automatically in the fields attribute of a block name the layer on which it is inserted.
Is this possible?
Thank you in advance for your answers
Solved! Go to Solution.
Solved by abr6304. Go to Solution.
I must draw many cables on a plane, everyone is on a separate layer and I have to put labels on each cable to identify it.
So I have a "attribute- block" that I have to insert on the plane, put on the right layer (the same as the cable) and then complete it with the name of the cable (it's also the name of the layer).
What I seek is that the block is complete alone when changing layer.
Do you think it's possible ?
I'm not sure if your concept can work or not, but you might be able to achieve your goal using an MLeader instead of an attributed block.
In the text of the MLeader, insert a Field that references an Object, select your Polyline object, select the Layer property, and set the Format.
When the Polyline's layer is changed (or the layer is renamed), the text in the MLeader will update after a regen.
If necessary, you can use DataExtraction to create a table listing the text content of each MLeader.
mayby you post a sample
cw
"I can not use Mleader because the design of the label is fixed..."
"Fixed" by what? What is forcing you to use the current label design? What do you loose if you change it?
Please post a DWG file containing the block you are trying to use.
Note:
1. It is possible to create an MLeader that has no "leader" portion, and also has a background mask to act like a "wipeout".
2. You can also use MText to do essentially the same thing.
The design of the label is fixed because I belong to a company with several drawing office here and everything is standardized so that each office uses the same SYMBOLS so I can not move to the appearance of the label in printing, but I try to make use of the preferred designer.
I attach a small snippet of the type of plan that I have done with how I made labels for the moment (field + block)
Thanks for your answers
I attach a small snippet of the type of plan that I have done with how I made labels for the moment (field + block) but I would not have two bodies but one.
Thank you in advance for your answers
In English below
Ok je vais détailler :
J'ai créé un block sur le layer 0
Dans ce block j'ai d'abord une Wipeout et ensuite une polyline par dessus, le tout forme une "étiquette vide"
J'insère le block sur le layer du câble à repérer, ensuite je crée un field qui "lit" le layer du bloc.
Finalement je fait un regen et le field indique le layer du bloc
Mais je voudrais ne plus avoir deux entités ( un block et un field ) mais une seule que je pourrait insérer sur le le câble et qui "lirait" le layer du câble et non pas celui du bloc "étiquette"
Je joins un extrait du type de plan à réaliser avec ma manière actuelle de travailler
D'avance merci pour vos réponses
In english (auto translate)
Ok I will detail:
I created a block on layer 0
In this block I first have a Wipeout then a polyline over, the whole forms a "blank label"
I insert the block on the layer of the cable to identify, then I create a field that "reads" the block layer.
Finally I made a regen and field indicates the block layer
But I would not have two entities (a block and a field) but one that I could insert the cable and "read" the layer of the cable (a polyline) and not the block layer
I enclose an extract from the type of plan to achieve with my current way of working
Thank you in advance for your answers
Thank you for the detailed description.
If I understand you correctly...
You can certainly modify the block (Tete-de-cable-auto, for example) by adding the MText with the Field, and then editing the Field to report the layer of the Polyline within the block. Currently the Polyline within the block is on layer Tete-cable, but you have said you want the Field to report the name of the layer on which the block is inserted (a layer named for a cable identifier). In order for that to work, that Polyline will have to be placed on the layer you want the Field to report. This means you would have to have a different block definition for each different layer name.
Unfortunately, once the MText with the Field is added to the block definition (via Refedit or Bedit), there is no way to point the Field to a specific insert of that block to get to its layer. (You can't point to the thing that you are currently editing.)
You could try making a "compound" block by combining an insert of the block (on the correct layer) and the MText with the Field pointing to the block insert's layer, but if the same block might be inserted on several different layers within the same DWG, you would still have to produce a unique block definition for each different layer.
You might be able to achieve a single object with functionality similar to this by creating a Dynamic Block with multiple visibility states, in which each has a piece of Text or MText containing a layer name (cable identifier) which the user would select from a drop-down list. But with this method you would not get the automation I think you desire.
You might also look into using a Group to keep together your label block insert and its associated MText+Field.
Ok
perfect
This solution works perfectly
I have a single entity, a group, that I can copy as many times as necessary and updates with a simple regen giving the name of the layer in the field on which the label is
That's what I was looking for
Thank's for all
Morning
but with this , you have to care all time that you change the Layer of the Block also ?
isent it mayby easyer to make a linetype with the code inside ?
or is there a tool what make you are a lable wtih a link to the objekt line
cw
When you are inside the block editor and you define an attribute (with ATTDEF), there is a "insert filed" button just right of the "Default" vaule. There you can, under field names choose "BlockPlaceholder" , then under Block Reference Property choose "Layer". That will show the layer where the block is inserted - if I understood you well. Do not forget to Regen to update those attributes after you changed the layer.
Wonderful solution!
Simple, clean, clear
Exactly what I like
A big thank you