matteoluigi Posted October 14 Share Posted October 14 Hi, does there exist a command which get's me a PIO stylename from an object with a handle? Or do I need a complete other aproach for that? Via a plugin record format? And then, how do I set that stylename? thx, Matteo Quote Link to comment
Pat Stanford Posted October 14 Share Posted October 14 Take a look at GetPluginStyle, GetPluginStyleSymbol, SetPluginStyle 1 Quote Link to comment
matteoluigi Posted October 14 Author Share Posted October 14 😳 wonder why I didn't find them on my cmd+f search on the developer function reference, I tried with style,..Name,... Maybe I need new glasses (I will fetch my original ones from being fixed ASAP) Quote Link to comment
Pat Stanford Posted October 14 Share Posted October 14 I think I started with a search for "style" and after I found GetPluginStyle I switched to "plugin". 🤷♂️ 1 Quote Link to comment
matteoluigi Posted October 14 Author Share Posted October 14 definitely not confused but, well, thanks for your help!!! Quote Link to comment
matteoluigi Posted October 15 Author Share Posted October 15 hm, now I can read a stylename but how can I change it??? SetPluginStyle assigns a PluginStyle to an object SetWallStyle and SetSlabStyle do the same thing with wall, slab styles SetName seems only to work on Symbols, my first tries on renaming PIOS, walls, slabs... failed... still working on it, thought it would be easier 😄 Quote Link to comment
Pat Stanford Posted October 15 Share Posted October 15 More detail about what you are trying to do please. You want to find the name of a Style and then rename it? Quote Link to comment
matteoluigi Posted October 15 Author Share Posted October 15 yes, the script I'm writing basically is about checking the object-names. We have a coding-system which assigns ifc-data to objects via the data-manager. I already am able to check componentnames from walls, slabs, roofs. Now I also want to read symbolnames, PIO-Names, wallstyle, slabstyle, roofstylenames, check them on various purposes (the checking code is already ok and working) and rename the objects. Here a simple example def process_objects(obj_handle): obj_type = vs.GetTypeN(obj_handle) if obj_type == 15: symbol_name=vs.GetSymName(obj_handle) symbol_names.append(symbol_name) if symbol_name not in symbol_names else None sym_handle = vs.GetObject(symbol_name) vs.SetName(sym_handle,'SYMBOLTEST2') vs.AlrtDialog(symbol_name) if obj_type ==68: wallstyle_name=vs.GetWallStyle(obj_handle) wallstyle_names.append(wallstyle_name) if wallstyle_name not in wallstyle_names else None vs.SetName(obj_handle,'WA-A-XXX-XX3') # vs.SetWallStyle does only apply a Wall-Style to the object. vs.AlrtDialog(wallstyle_name) if obj_type ==70: slabstyle_name=vs.GetSlabStyle(obj_handle) slabstyle_name = vs.Index2Name(slabstyle_name) slabstyle_names.append(slabstyle_name) if slabstyle_name not in slabstyle_names else None vs.SetName(obj_handle,'DE-A-XXX-XX4') # vs.SetSlabStyle does only apply a Slab-Style to the object. vs.AlrtDialog(slabstyle_name) if obj_type ==86: piostyle_name=vs.GetPluginStyle(obj_handle) # piostyle_name = vs.Index2Name(piostyle_name) piostyle_names.append(piostyle_name) if piostyle_name not in piostyle_names else None vs.SetName(obj_handle,'FE-A-XXX-XX1') # vs.SetPluginStyle only applies a PluginStyle to the object and doesn't reset the PluginStyleName vs.AlrtDialog(piostyle_name) if obj_type ==101: roofstyle_name=vs.GetRoofStyle(obj_handle) roofstyle_name = vs.Index2Name(roofstyle_name) roofstyle_names.append(roofstyle_name) if roofstyle_name not in roofstyle_names else None vs.SetName(obj_handle,'DA-A-XXX-XX6') # vs.SetRoofStyle does only apply a Roof-Style to the object. vs.AlrtDialog(roofstyle_name) # Daten in die Tabelle (Stiltabelle) schreiben Zeile = 2 # Startzeile (nach den Überschriften) vs.ForEachObject(process_objects,"((L='TEST'))") Quote Link to comment
matteoluigi Posted October 15 Author Share Posted October 15 ... made it with the name and the setname command ... *confused* at least it worked with a wall-style... Quote Link to comment
matteoluigi Posted October 15 Author Share Posted October 15 xcuse me, I't mixing up handles which are relating to objects and handles which are relating to resource objects 🙄 sry Quote Link to comment
Pat Stanford Posted October 15 Share Posted October 15 Been there, done that. Glad you got it sorted. Quote Link to comment
Pat Stanford Posted October 15 Share Posted October 15 Many times just the act of typing our the question here will give your brain time to figure out the answer. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.