подготовлено к подключению
This commit is contained in:
parent
e6c1a3fece
commit
a848d92a14
1 changed files with 14 additions and 6 deletions
|
@ -9,13 +9,14 @@ doc = App.ActiveDocument
|
|||
#функции для создания обьектов PDDL
|
||||
|
||||
def add_types():
|
||||
types = doc.addObject('App::FeaturePython', 'Types')
|
||||
types = doc.addObject('App::FeaturePython', 'types')
|
||||
types.addProperty("App::PropertyString", 'PDDL', 'PDDL').PDDL = 'PDDL'
|
||||
types.addProperty("App::PropertyStringList", 'Type', 'PDDL').Type = 'Types'
|
||||
types.addProperty("App::PropertyString", 'Type', 'PDDL').Type = 'Types'
|
||||
types.addProperty("App::PropertyStringList", 'Types', 'PDDL')
|
||||
sortEntity(types)
|
||||
print('Types of objects added successfully')
|
||||
return(types)
|
||||
#слишком много types
|
||||
|
||||
def add_parameters():
|
||||
|
||||
|
@ -173,11 +174,18 @@ def export_to_file(file_path):
|
|||
|
||||
def sortEntity(object):
|
||||
#если нету директории, то создадим ее
|
||||
if doc.getObjectsByLabel(object.Type) == 0:
|
||||
pddl_group = doc.addObject("App::DocumentObjectGroup", str(object.Type))
|
||||
# if len(doc.getObjectsByLabel(object.Type)) == 0 :
|
||||
# pddl_group = doc.addObject("App::DocumentObjectGroup", object.Type)
|
||||
# else:
|
||||
pddl_group = doc.addObject("App::DocumentObjectGroup", object.Type)
|
||||
|
||||
if len(doc.getObjectsByLabel(object.Type)) == 0:
|
||||
pddl_group = doc.addObject("App::DocumentObjectGroup", object.Type)
|
||||
else:
|
||||
pddl_group = doc.getObject(str(object.Type))
|
||||
pddl_group.addObject(object)
|
||||
pddl_group = doc.getObjectsByLabel(object.Type)[0]
|
||||
pddl_group.addObject(object)
|
||||
|
||||
|
||||
Gui.updateGui()
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue