许可优化
许可优化
产品
产品
解决方案
解决方案
服务支持
服务支持
关于
关于
软件库
当前位置:服务支持 >  软件文章 >  CATIA VBA:在新窗口打开子装配教程

CATIA VBA:在新窗口打开子装配教程

阅读数 1950
点赞 82
article_banner
Sub CATMain()
    Dim InputObjectType(0)
    InputObjectType(0) = "Product"
    Dim oProductDoc
    Set oProductDoc = CATIA.ActiveDocument
    Dim oSelection
    Set oSelection = oProductDoc.Selection
    oSelection.Clear
    Dim aSel
    aSel = oSelection.SelectElement2(InputObjectType, "Select the part to open in a new window", False)
    Dim oProduct
    Set oProduct = oSelection.FindObject("CATIAProduct" )
    Dim prodToOpen as Document
    Set prodToOpen = oProduct.ReferenceProduct.Parent
    prodToOpen.NewWindow 'This is openeing the main product but should open the part?'
    oSelection.Clear
End Sub

Replace all of this....

Dim oProduct
Set oProduct = oSelection.FindObject("CATIAProduct" )

Dim prodToOpen as Document
Set prodToOpen = oProduct.ReferenceProduct.Parent

prodToOpen.NewWindow 'This is openeing the main product but should open the part?

oSelection.Clear

With this....


If aSel = "Normal" Then
CATIA.StartCommand "Open in New Window"
Else
'Take some other action...
End If

As long as an instance is selected, this command will open the part in it's own window. I added a check to be sure the selection was successful before calling because if nothing is selected CATIA just ignores the command plus you might want to take some other action...

http://www.coe.org/p/fo/et/thread=18534


武汉格发信息技术有限公司,格发许可优化管理系统可以帮你评估贵公司软件许可的真实需求,再低成本合规性管理软件许可,帮助贵司提高软件投资回报率,为软件采购、使用提供科学决策依据。支持的软件有: CAD,CAE,PDM,PLM,Catia,Ugnx, AutoCAD, Pro/E, Solidworks ,Hyperworks, Protel,CAXA,OpenWorks LandMark,MATLAB,Enovia,Winchill,TeamCenter,MathCAD,Ansys, Abaqus,ls-dyna, Fluent, MSC,Bentley,License,UG,ug,catia,Dassault Systèmes,AutoDesk,Altair,autocad,PTC,SolidWorks,Ansys,Siemens PLM Software,Paradigm,Mathworks,Borland,AVEVA,ESRI,hP,Solibri,Progman,Leica,Cadence,IBM,SIMULIA,Citrix,Sybase,Schlumberger,MSC Products...

相关文章
QR Code
微信扫一扫,欢迎咨询~
customer

online

联系我们
武汉格发信息技术有限公司
湖北省武汉市经开区科技园西路6号103孵化器
电话:155-2731-8020 座机:027-59821821
邮件:tanzw@gofarlic.com
Copyright © 2023 Gofarsoft Co.,Ltd. 保留所有权利
遇到许可问题?该如何解决!?
评估许可证实际采购量? 
不清楚软件许可证使用数据? 
收到软件厂商律师函!?  
想要少购买点许可证,节省费用? 
收到软件厂商侵权通告!?  
有正版license,但许可证不够用,需要新购? 
联系方式 board-phone 155-2731-8020
close1
预留信息,一起解决您的问题
* 姓名:
* 手机:

* 公司名称:

姓名不为空

姓名不为空

姓名不为空
手机不正确

手机不正确

手机不正确
公司不为空

公司不为空

公司不为空