assembly: fix Part.getShape() for Assembly container
This commit is contained in:
parent
ce6b13bdd1
commit
61ccdf5bac
21
assembly.py
21
assembly.py
|
@ -1338,6 +1338,25 @@ class Assembly(AsmGroup):
|
||||||
self.constraints = None
|
self.constraints = None
|
||||||
super(Assembly,self).__init__()
|
super(Assembly,self).__init__()
|
||||||
|
|
||||||
|
def getSubObjects(self,obj):
|
||||||
|
if obj.BuildShape==BuildShapeNone:
|
||||||
|
partGroup = self.getPartGroup()
|
||||||
|
return ['{}.{}'.format(partGroup.Name,name)
|
||||||
|
for name in partGroup.getSubObjects()]
|
||||||
|
|
||||||
|
def getSubObject(self,obj,subname,retType,mat,transform,depth):
|
||||||
|
if obj.BuildShape==BuildShapeNone:
|
||||||
|
if not subname or subname.startswith(';') or subname.find('.')<0:
|
||||||
|
_ = depth
|
||||||
|
if not retType:
|
||||||
|
return
|
||||||
|
if transform:
|
||||||
|
mat *= obj.Placement.toMatrix()
|
||||||
|
if retType==1:
|
||||||
|
return (obj,mat)
|
||||||
|
return (obj,mat,None)
|
||||||
|
return False
|
||||||
|
|
||||||
def _collectParts(self,oldParts,newParts,partMap):
|
def _collectParts(self,oldParts,newParts,partMap):
|
||||||
for part in newParts:
|
for part in newParts:
|
||||||
try:
|
try:
|
||||||
|
@ -1444,7 +1463,7 @@ class Assembly(AsmGroup):
|
||||||
return
|
return
|
||||||
|
|
||||||
shape = []
|
shape = []
|
||||||
partGroup = self.getPartGroup(obj)
|
partGroup = self.getPartGroup()
|
||||||
group = partGroup.Group
|
group = partGroup.Group
|
||||||
if not group:
|
if not group:
|
||||||
raise RuntimeError('no parts')
|
raise RuntimeError('no parts')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user