CATIA V5 VBA: get CATPart linked documents

混江龙づ霸主 提交于 2019-12-10 12:11:24

问题


Is there a way for a catscript/catvbs/catvba to access all the Pointed Documents of a CATPart?

I need to retrieve a list of all the Pointed Documents filepaths (similarly to what an interactive user gets with the menu View-->Edit Links-->Pointed Documents tab)

CATIA V5 Automation seems to expose such APIs only for CATDrawings. For each DrawingView object you can get the Pointed Document with:

PointedDocFullPath = MyDrawingView.GenerativeBehavior.Document.Parent.FullName

But, how can I get CATPart links?


回答1:


Try CAIEngine and 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()

Good luck



来源:https://stackoverflow.com/questions/22823475/catia-v5-vba-get-catpart-linked-documents

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!