0

有没有办法让 catscript/catvbs/catvba 访问 CATPart 的所有指向文档?

我需要检索所有 Pointed Documents 文件路径的列表(类似于交互式用户通过菜单 View->Edit Links->Pointed Documents 选项卡获得的内容)

CATIA V5 自动化似乎只为CATDrawings 公开此类API。对于每个DrawingView对象,您可以获得指向文档:

PointedDocFullPath = MyDrawingView.GenerativeBehavior.Document.Parent.FullName

但是,如何获得CATPart链接?

4

1 回答 1

1

试试 CAIEngine 和 stiDbItems:

stiEngine = catia.GetItem("CAIEngine")    
# The GetStiDBItemFromAnyObject() needs a document object as parameter.
stiDbItem = stiEngine.GetStiDBItemFromAnyObject(product.ReferenceProduct.Parent)
stiChildren = stiDbItem.GetChildren()
for i in xrange(1, stiChildren.Count + 1):
  fullPath = stiChildren.Item(i).GetDocumentFullPath()

祝你好运

于 2014-04-22T13:41:28.267 回答