**
文章目录
相关网址及本地doc
插件 — Plugins (pixyz-software.com)
Introduction – Pixyz API Reference (pixyz-software.com)
C:/Users/Admin/AppData/Roaming/PiXYZStudio/doc/index.html
简介
pixyz 插件有两部分组成:由py文件组成的脚本和由xml文件组成的界面,其中没有xml文件,pixyz不会检测到这个插件
插件文件必须放置在计算机上的ProgramData
(%programdata%/PixyzStudio/plugins)文件夹或者AppData
(%appdata%/PixyzStudio/plugins)文件夹下
编写代码
python文件示例:
def MergeByFloor(merge,structureList):
#先合并最终极使所选单位减少
#scene.mergeFinalLevel([1], 1, False)
#遍历结构列表
if len(structureList)==0:
return
for structure in structureList :
#有后缀,走这一步
if structure.Suffix:
#组合所输入楼层名
floors = [structure.FloorPrefix+"{:02}".format(i) for i in range(structure.Start, structure.End+1)]
print(floors)
#遍历楼层
for floor in floors:
#按照元数据查找楼层物体
OccurrenceList=scene.findByMetadata("Text/所属楼层", floor, [])
if len(OccurrenceList)==0:
continue
#如果选择合并
if merge:
OccurrenceList=MergeParts(OccurrenceList)
MoveToOccurrence(OccurrenceList,1)
ReName(OccurrenceList,floor)
else:
MoveToOccurrence(OccurrenceList,scene.createOccurrence(floor,1))
#无后缀,走这一步
else:
floor = structure.FloorPrefix
OccurrenceList=scene.findByMetadata("Text/所属楼层", floor, [])