我的msn:heavy.zhou@hotmail.com
QQ:382420654作者: cupcake 时间: 2009-2-24 14:11
看看这个对你有用吗?
SchematicRoot
Returns the object factory for specific schematic application.
Example:
This example illustrates how to get the object factory of user defined virtual type. User provides implementation to this type.
Dim objSchPlatformRoot As SchematicRoot
Dim objSchObjFact As SchAppObjectFactory
Dim objProductRoot As Product
Set objProductRoot = CATIA.ActiveDocument.Product
Set objSchPlatformRoot = objProductRoot.GetTechnologicalObject ("SchematicRoot")
Set objSchObjFact = objSchPlatformRoot.GetApplObjFactFromVirtualType("UserDefined")(
我加了你的msn作者: hzhou 时间: 2009-2-24 17:04
谢谢你的回复!
我的msn还没有看到你啊,你的MSN是多少?作者: acoka 时间: 2009-2-27 23:32
Dim yourPartDoc as PartDocument ( or Document)
set youPartDoc = ....
Dim DocFullName as String
DocFullName = Doc.FullName
The returned value is like this:
e:\users\psr\Parts\MyNicePart.CATPart作者: hzhou 时间: 2009-3-2 10:02
acoka 你好!请问你的set youPartDoc = ... 该如何获取?我添加了一个含有link的part。这个该如何解决。
谢谢!!作者: wyf1983_2008 时间: 2009-3-2 11:47
Set Document = CATIA.ActiveDocument : Set Part = Document.Part作者: hzhou 时间: 2009-3-4 09:30
谢谢大家的帮助, 该问题已经解决。代码如下,和大家一起分享:
Dim partDocument1 As Document
Set partDocument1 = CATIA.ActiveDocument
Dim part1 As Part
Set part1 = partDocument1.Part
Dim selection1 As Selection
Set selection1 = partDocument1.Selection
Dim selection2 As Selection
Dim oStiEngine As StiEngine
Set oStiEngine = CATIA.GetItem("CAIEngine")
Dim oStiDBItem As StiDBItem
Set oStiDBItem = oStiEngine.GetStiDBItemFromAnyObject(partDocument1)
Dim oDocument As Document
Set oDocument = oStiDBItem.GetDocument
'MsgBox oDocument.Name
Dim oStiDBChildren As StiDBChildren
Set oStiDBChildren = oStiDBItem.GetChildren()
'MsgBox oStiDBChildren.Name
Dim oNbChildren As Integer
oNbChildren = oStiDBChildren.Count
Dim i As Integer
'MsgBox oNbChildren
Dim sChildLinkType As String
Dim oStiDBItem2 As StiDBItem
Dim oDocument2 As Document
For i = oStiDBChildren.Count To 1 Step -1
sChildLinkType = oStiDBChildren.LinkType(i)
MsgBox sChildLinkType
Set oStiDBItem2 = oStiDBChildren.Item(i)
'Set oDocument2 = oStiDBItem2.GetDocumentFullPath
MsgBox oStiDBItem2.GetDocumentFullPath
Next