资源描述:
《《参数设置》PPT课件.ppt》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、参数设置参数设置SW二次开发VB讲座一.自定义参数*自定义参数(零件、装配与图纸)参数设置SW二次开发VB讲座*自定义参数程序SetswApp=Application.SldWorksSetPart=swApp.ActiveDocDimCusPropMgrAsSldWorks.CustomPropertyManagerSetCusPropMgr=Part.Extension.CustomPropertyManager("")DimaddstatusAsLongaddstatus=CusPropMgr.
2、Add2("图号",swCustomInfoText,"AB-150-008")addstatus=CusPropMgr.Add2("Material",swCustomInfoText,Chr(34)+"SW-Material@零件1.SLDPRT"+Chr(34))addstatus=CusPropMgr.Add2("Weight",swCustomInfoText,Chr(34)+"SW-Mass@零件1.SLDPRT"+Chr(34))addstatus=CusPropMgr.Add2("日期
3、",swCustomInfoDate,"2011-08-15")参数设置SW二次开发VB讲座一.自定义参数*自定义参数更改、获取与删除addstatus=CusPropMgr.Set("图号","AB-150-007")addstr=CusPropMgr.Get(“Material”)CusPropMgr.Delete("日期")自定义参数遍历DimNamesAsVariantDimNamelongasLongDimNonameAsStringNamelong=CusPropMgr.CountName
4、s=CusPropMgr.GetNamesFori=0toNamelongNoname=Names(i)Nexti参数设置SW二次开发VB讲座一.自定义参数二.配置特定参数*配置特定参数参数设置SW二次开发VB讲座*配置特定参数SetswApp=Application.SldWorksSetPart=swApp.ActiveDocDimretvalAsVariantDimCusPropMgrAsSldWorks.CustomPropertyManagerretval=Part.GetConfigura
5、tionNames()SetCusPropMgr=Part.Extension.CustomPropertyManager(retval(UBound(retval)))DimaddstatusAsLongaddstatus=CusPropMgr.Add2("图号A",swCustomInfoText,"AB-150-008")addstatus=CusPropMgr.Add2("MaterialA",swCustomInfoText,Chr(34)+"SW-Material@零件1.SLDPRT"+
6、Chr(34))addstatus=CusPropMgr.Add2("WeightA",swCustomInfoText,Chr(34)+"SW-Mass@零件1.SLDPRT"+Chr(34))addstatus=CusPropMgr.Add2("日期A",swCustomInfoDate,"2011-08-15")参数设置SW二次开发VB讲座二.配置特定参数三.摘要参数*摘要参数参数设置SW二次开发VB讲座*摘要参数SetswApp=Application.SldWorksSetPart=swAp
7、p.ActiveDocPart.SummaryInfo(SwConst.swSumInfoAuthor)="AAAA"Part.SummaryInfo(SwConst.swSumInfoKeywords)="BBBB"Part.SummaryInfo(SwConst.swSumInfoComment)="CCCC"Part.SummaryInfo(SwConst.swSumInfoTitle)="DDDD"Part.SummaryInfo(SwConst.swSumInfoSubject)="EEEE
8、“该信息的编辑处理:修改是在该项上重新输入删除只能再次输入=""获取则为=Part.SummaryInfo(SwConst.swSumInfoKeywords)参数设置SW二次开发VB讲座三.摘要参数谢谢!*参数设置SW二次开发VB讲座