收藏 分销(赏)

inventor学徒服务器Apprentice.pptx

上传人:天**** 文档编号:2403826 上传时间:2024-05-29 格式:PPTX 页数:11 大小:198.05KB 下载积分:8 金币
下载 相关 举报
inventor学徒服务器Apprentice.pptx_第1页
第1页 / 共11页
inventor学徒服务器Apprentice.pptx_第2页
第2页 / 共11页


点击查看更多>>
资源描述
1Autodesk Confidential Information January 2010Using ApprenticeGary WassellDeveloper Technical Services2Autodesk Confidential Information January 2010Agenda Apprentice Definition Apprentice Functionalities Guidelines Apprentice vs.Inventor:Differences Saving Files with Apprentice3Autodesk Confidential Information January 2010ApprenticeInventor DataInventor ApplicationClient AppAdd-InVBAApprenticeAdd-InClient App4Autodesk Confidential Information January 2010Apprentice ServerApprentice is an ActiveX component.Runs In-process with the client using it.Apprentice Server provides a subset of the Inventor API.Can be used standalone(doesnt require Inventor).Provided at no cost(installed as part of Inventor View).Apprentice can be very efficient for certain tasks in comparison of connecting to Inventor out-of-process.5Autodesk Confidential Information January 2010Apprentice FunctionalitiesProvides read-only access to:Assembly structureB-RepDrawing sheets and views(limited access)iPartsiAssembliesBOMProvides read/write access to iProperties,attributes,and file references.6Autodesk Confidential Information January 2010Apprentice-GuidelinesShould NOT be used in-process to Inventor.Not in an Add-In(exe type of Add-In is ok).Not through Inventors VBA.Prior to Inventor 11,Apprentice was the only way to edit file references.(Design Assistant is build on top of Apprentice.)Prior to 2008,the Apprentice functionalities were provided in its own type library.Now Autodesk Inventor type library contains all of the Apprentice functionality Add a reference to Inventor.Interop for an Apprentice project.7Autodesk Confidential Information January 2010Apprentice vs.Inventor:differencesInstantiated using“new ApprenticeServerComponent”No Documents collection in ApprenticeDocument object:ApprenticeServerDocument(*.ipt&*.iam)ApprenticeServerDrawingDocument(*.idw)Apprentice cannot save a file from a previous version,i.e.that is not migrated.You will need to migrate the file prior to save it with Apprentice:To migrate a file,open it with Inventor,save it and close it.8Autodesk Confidential Information January 2010Apprentice-ExamplePrivate Sub ApprenticeSample()Create Apprentice.Dim oApprentice As ApprenticeServerComponent oApprentice=New ApprenticeServerComponent Open a document.Dim oDoc As ApprenticeServerDocument oDoc=oApprentice.Open(C:TempPart.ipt)MsgBox(Opened:&oDoc.DisplayName)End Sub9Autodesk Confidential Information January 2010Saving Files with ApprenticeUse FlushToFile if the iProperties ONLY were modified:more efficient,since the document is not written back.Private Sub SetProperty(ByVal author As String)Dim oApprenticeDoc As ApprenticeServerDocument oApprenticeDoc=mApprenticeServer.Open(c:TempMyPart.ipt)Get Inventor Summary Information PropertySet Dim oPropertySet As PropertySet oPropertySet=oApprenticeDoc.PropertySets(F29F85E0-4FF9-1068-AB91-08002B27B3D9)Get Author property Dim oProperty As Inventor.Property=oPropertySet.Item(Author)oProperty.Value=author oApprenticeDoc.PropertySets.FlushToFile()oApprenticeDoc.Close()End Sub10Autodesk Confidential Information January 2010Saving Files with ApprenticeFor any other change use FileSaveAs object:Private Sub SaveFileSample()Dim oApprentice As New ApprenticeServerComponent Open a document.Dim oDoc As ApprenticeServerDocument oDoc=oApprentice.Open(C:TempAssembly1.iam)Do some change:iProperties and attributes and/or file references.Set a reference to the FileSaveAs object.Dim oFileSaveAs As FileSaveAs oFileSaveAs=oApprentice.FileSaveAs Save the file.Call oFileSaveAs.AddFileToSave(oDoc,oDoc.FullFileName)Call oFileSaveAs.ExecuteSave()End Sub11Autodesk Confidential Information January 2010
展开阅读全文

开通  VIP会员、SVIP会员  优惠大
下载10份以上建议开通VIP会员
下载20份以上建议开通SVIP会员


开通VIP      成为共赢上传

当前位置:首页 > 包罗万象 > 大杂烩

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        抽奖活动

©2010-2026 宁波自信网络信息技术有限公司  版权所有

客服电话:0574-28810668  投诉电话:18658249818

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :微信公众号    抖音    微博    LOFTER 

客服