示例#1
0
 def execute(self, context):
     props = context.scene.BCFProperties
     blender_topic = props.active_topic
     bcfxml = bcfstore.BcfStore.get_bcfxml()
     topic = bcfxml.topics[blender_topic.name]
     topic.title = blender_topic.title
     bcfxml.edit_topic(topic)
     return {"FINISHED"}
示例#2
0
 def execute(self, context):
     bcfxml = bcfstore.BcfStore.get_bcfxml()
     props = context.scene.BCFProperties
     blender_topic = props.active_topic
     topic = bcfxml.topics[blender_topic.name]
     del topic.labels[self.index]
     bcfxml.edit_topic(topic)
     blender_topic.labels.remove(self.index)
     return {"FINISHED"}
示例#3
0
 def execute(self, context):
     bcfxml = bcfstore.BcfStore.get_bcfxml()
     props = context.scene.BCFProperties
     blender_topic = props.active_topic
     topic = bcfxml.topics[blender_topic.name]
     del topic.related_topics[self.index]
     bcfxml.edit_topic(topic)
     bpy.ops.bim.load_bcf_topic(topic_guid=topic.guid,
                                topic_index=props.active_topic_index)
     return {"FINISHED"}
示例#4
0
 def execute(self, context):
     bcfxml = bcfstore.BcfStore.get_bcfxml()
     props = context.scene.BCFProperties
     blender_topic = props.active_topic
     topic = bcfxml.topics[blender_topic.name]
     new = blender_topic.labels.add()
     new.name = props.label
     topic.labels.append(props.label)
     bcfxml.edit_topic(topic)
     props.label = ""
     return {"FINISHED"}
示例#5
0
 def execute(self, context):
     bcfxml = bcfstore.BcfStore.get_bcfxml()
     props = context.scene.BCFProperties
     blender_topic = props.active_topic
     topic = bcfxml.topics[blender_topic.name]
     topic.reference_links.append(props.reference_link)
     bcfxml.edit_topic(topic)
     bpy.ops.bim.load_bcf_topic(topic_guid=topic.guid,
                                topic_index=props.active_topic_index)
     props.reference_link = ""
     return {"FINISHED"}
示例#6
0
 def execute(self, context):
     bcfxml = bcfstore.BcfStore.get_bcfxml()
     props = context.scene.BCFProperties
     blender_topic = props.active_topic
     topic = bcfxml.topics[blender_topic.name]
     for index, reference_link in enumerate(topic.reference_links):
         if reference_link == blender_topic.reference_links[index].name:
             continue
         topic.reference_links[index] = blender_topic.reference_links[
             index].name
     bcfxml.edit_topic(topic)
     return {"FINISHED"}
示例#7
0
 def execute(self, context):
     bcfxml = bcfstore.BcfStore.get_bcfxml()
     props = context.scene.BCFProperties
     blender_topic = props.active_topic
     topic = bcfxml.topics[blender_topic.name]
     for index, label in enumerate(blender_topic.labels):
         if index >= len(topic.labels):
             break
         if label.name == topic.labels[index]:
             continue
         topic.labels[index] = blender_topic.labels[index].name
     bcfxml.edit_topic(topic)
     return {"FINISHED"}
示例#8
0
 def execute(self, context):
     bcfxml = bcfstore.BcfStore.get_bcfxml()
     props = context.scene.BCFProperties
     blender_topic = props.active_topic
     related_topic = bcf.v2.data.RelatedTopic()
     related_topic.guid = next((t for t in bcfxml.topics.values()
                                if t.title == props.related_topic)).guid
     topic = bcfxml.topics[blender_topic.name]
     topic.related_topics.append(related_topic)
     bcfxml.edit_topic(topic)
     bpy.ops.bim.load_bcf_topic(topic_guid=topic.guid,
                                topic_index=props.active_topic_index)
     props.related_topic = ""
     return {"FINISHED"}
示例#9
0
    def execute(self, context):
        props = context.scene.BCFProperties
        blender_topic = props.active_topic
        bcfxml = bcfstore.BcfStore.get_bcfxml()

        topic = bcfxml.topics[blender_topic.name]
        topic.title = blender_topic.title or None
        topic.priority = blender_topic.priority or None
        topic.due_date = blender_topic.due_date or None
        topic.assigned_to = blender_topic.assigned_to or None
        topic.stage = blender_topic.stage or None
        topic.description = blender_topic.description or None
        topic.topic_status = blender_topic.status or None
        topic.topic_type = blender_topic.type or None

        bcfxml.edit_topic(topic)
        props.refresh_topic(context)
        return {"FINISHED"}