Jump to content
Developer Wiki and Function Reference Links ×

Command for getting and setting a PIO stylename?


Recommended Posts

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 😄

Link to comment

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'))")

 

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...