Hi,
Can we filter the layers visible in the palette with
<ValueType>Layer</ValueType>?
For example, I'd like to choose between specific layers instead of all of them.
Best
Hi,
Can we filter the layers visible in the palette with
<ValueType>Layer</ValueType>?
For example, I'd like to choose between specific layers instead of all of them.
Best
Here the solution :
edit : in modify_control_properties
if value_name == "Designation": layer = f"MIL_04_PAROIS_{build_ele.Designation.value}" try: layer_id = BaseElements.LayerService.GetIDByShortName(layer, doc) except: layer_id = -1 build_ele.Layer.value = layer_id
I'm trying to get the ID from the designation value, if I can't the default layer is set
Best
Christophe
<ValueType>Layer</ValueType> ?For example, I'd like to choose between specific layers instead of all of them.
Best
unfortunately, it is not possible yet. How would you like to filter the layers? Can you give some examples or use-cases?
Best,
Bart
Hi,
For example, if I use the script "ParoisPoseVert" - which is a "wall" - I'd like Allplan to offer me layers containing "MIL-04-PAROIS-*".
PS :
In this particular case, the best would be an automatic selection of the layer based on the attribute.
If the user set "26", the layer proposed by default would be "MIL-04-PAROIS-26" (in our template, 50 layers are already created) with this
Best
Hi,
for now it is not possible. You can only place the very standard layer selector in the palette. What you could do, is place a regular combo box. But you would have to know the layer names in advance, since there is no method for getting all the available layers. When you know, the layer name, you could use the LayerService to get the layer ID based on that. And the next disadvantage would be, that you would not have the option "Selection..." in the combo box, which opens the window with layer selection.
If you could get all the available layer IDs (and because you can get Layer Name from ID with LayerService, you would be available to also get the Layer names), would it solve your problem?
Best,
Bart
Hi,
I can test if the layer "MIL-04-PAROIS-" + {Designation} exists
If yes I get the ID with GetIDByShortName
If not the user selects the layer as he want
I will try it
Best
Christophe
Bonjour Christophe,
You can also open the ‘layerdef.dat’ file directly from the project or STD (if in Project or Office mode), search through the lines to find the corresponding layer and load its number.
I also reply in French, because Christophe and I are French...
Tu peux aussi ouvrir directement le fichier "layerdef.dat" du projet ou de STD (si en mode Projet ou Bureau), parcourir les lignes pour trouver le layer correspondant et en charger son numéro.
Bonne journée !
Best,
Bart
That's what I meant by "from the project or STD (if in Project or Office mode)", but it wasn't clear.
Thank you for the clarification.
Here the solution :
edit : in modify_control_properties
if value_name == "Designation": layer = f"MIL_04_PAROIS_{build_ele.Designation.value}" try: layer_id = BaseElements.LayerService.GetIDByShortName(layer, doc) except: layer_id = -1 build_ele.Layer.value = layer_id
I'm trying to get the ID from the designation value, if I can't the default layer is set
Best
Christophe