




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
TeklaOpenAPIAdvancedTrainingDrawingPlugins––BoltDimensionSampleCharlesPool––SolutionsEngineerAgendaSomeKeyconceptsPluginArchitectureSetupPluginBasicArchitectureTogetherCreatingActualDimensioninDrawingHelperMethodsQuestionsandAnswers[Date]2[Date]3SomeKeyconceptsDrawingHandlerDrawingPartsViewsDimensionsTeklaOpenAPIDrawingBasicTraining/CharlesPoolDrawingHandlernewDrawingHandler();CheckifadrawingiscurrentlyopenGetActiveDrawing()checkifnullorDrawingGetsPickerforgettinginputfromuserCloses,Saves,andOpensdrawingsCanopendrawinghiddeninbackgroundSetActiveDrawing(myDrawing,false);Getdrawingsfromdrawinglist[Date]4DrawingobjectsDrawingobjectsarenotthesameasmodelobjectsPresentationobjectthatrepresentsthemodelobjectinthedrawinginterface.E.g.Color,accuracy,symbolCanbemanydifferenttypesofobjectsincludingtext,lines,marksCangetmodelobjectidentifierforthemodelpartthatthedrawingpartrepresentsYoucannotchangetheModelobjectwhenadrawingisopen,butyoucangetinformationfromit[Date]5DrawingBoltvs.ModelBolt[Date]6Tekla.Structures.Drawing.BoltTekla.Structures.Model.BoltGroupDrawingArchitecture(AssemblyDrawingwithSinglePart)[Date]7DrawingContainerView-SheetView(AssemblyFrontView)XYContainerView-SheetView(SinglePart)XYExampleAssemblyDrawing[Date]8ContainerView-SheetView(AssemblyFrontView)ContainerViewView(SinglePart)DimensionArchitecture[Date]9DrawingPartOffsetDirectionVectorDimensionPointsDimensionDirectionVectorsSetstheuppositionrelativetothedirectionthatistobedimensioned,always*90fromdimensionlineHorizontal,Vertical,SkewdimensionSetsthedirectiontowheredimensionisplacedLeft,Right,Up,DownfromobjectitisdimensioningSetusingaVector(xvalue,yvalue,zvalue)RelativetoDisplayCoordinateSystem[Date]10StraightDimensionSetHandlernewStraightDimensionSetHandler();Easiestwaytocreatedimension‘‘set’’SetismultipledimensionsgroupedtogetherCreateDimensionSet(View,Points,Direction,Offset);[Date]11[2011UserMeeting/CharlesPool]Example:Createdimensiontobolts[Date]12[Date]13PluginArchitectureGettinginputfromuser,startingplugin>ExamineStartuptemplatearchitectureTeklaOpenAPIDrawingBasicTraining/CharlesPoolStartupClassStartnewprojectusingtemplate““UM11_DrawingPlugin_Dimension””OpenPluginStartupClass.csThisclasscontainsthemainplugin‘‘meat”,therun()andDefineInput()Usethistogetuserinputandsetuptheinitialpluginbehavior[Date]14TeklaOpenAPIDrawingBasicTraining/CharlesPoolPluginSettingsPluginhasname––ShowninComponentCatalogDependancyUI–(INPbasedversusWinForms)UpdatemethodMustinherittheDrawingPluginBase[Date]15TeklaOpenAPIDrawingBasicTraining/CharlesPoolInternalsandConstructorStoreattributesdata,canusePropertyMusthavepublicConstructor[Date]16TeklaOpenAPIDrawingBasicTraining/CharlesPoolPluginAttributesDatafromUICanbeinthesamestartupclassorseparateclassasshownhereDefinepublicattributesSettheStructuresFieldtomatchexactlytheWinFormPropertyforAttributeNameandtypeshouldalsomatchtheAttributeTypeNamefield[Date]17TeklaOpenAPIDrawingBasicTraining/CharlesPoolAlwayspassedaList<InputDefinition>tostoreuserinputs.RunonlyoncewhenpluginisinsertedUsedforgettingpickpointsandobjectsfromuserforplugininputStoreinputfromuserintoList<>,returnList<>Usetry,catchwith:AddInputusing:[Date]18TeklaOpenAPIDrawingBasicTraining/CharlesPoolInheritstheList<InputDefinition>inputasanargumentautomaticallyfromtheDefineInput()methodExtractdatafrominputsList<>usingInputDefinitionFactory.GetView(inputs[0]);InputDefinitionFactory.GetPoint(inputs[0]);LoaddefaultsfromUIattributesGetmodelobjectsneededfromdrawingobjects[Date]19TeklaOpenAPIDrawingBasicTraining/CharlesPoolBugWorkarounds:WorkplaneWhenplugininsertsthecurrentcoordinatesystemisdifferentthanwhenthepluginismodifiedCanexplicitlysettheworkplanetodesiredplacesothatitisalwaysconsistentSetmanuallyfornow:HelperMethods.SetWorkPlane(myView.DisplayCoordinateSystem);[Date]20TeklaOpenAPIDrawingBasicTraining/CharlesPoolBugWorkarounds:ViewselectWhengettingtheviewitisnotalwaysselectedbydefaultWhengettingobjectsfromtheviewtheywillnotalwaysbeselected–intheviewcoordinatesystemRunmyView.Select()manuallyfornow…[Date]21TeklaOpenAPIDrawingBasicTraining/CharlesPoolBugWorkarounds:CheckIdentifer.IDWhengettingdrawingpartfrompicker,insomecasestheModelIdentifier.IDhasavalueof0InsuchcasesitwillnotbepossibletogetthemodelequivalentpartfromthedrawingpartandmostlikelyyourapplicationwillneedtocatchthisandterminateExampleCatch:[Date]22TeklaOpenAPIDrawingBasicTraining/CharlesPoolLaunchingseparateclasstorunlogicfrominputNotrequiredbutmakesplugineasiertomanageCanreturnboolvaluefromchildmethod[Date]23TeklaOpenAPIDrawingBasicTraining/CharlesPool[Date]24SetupPluginBasicArchitectureTogetherBoltDimension1TeklaOpenAPIDrawingBasicTraining/CharlesPoolIngroup:1personcodingSeveralbrainstormingStartwithMSVisualStudioPluginTemplateUM11_DrawingPlugin_Dimension[Date]25TeklaOpenAPIDrawingBasicTraining/CharlesPoolStartwithPluginStartup.csSetupinputinDefineInput()methodGetpointfromuserStoretoinputsFillinRun()methodGetdatafrominputs(view,modelpart)GetinputdefaultsLaunchseparateclasstocreatenewtemplateBoltDimension.cs[Date]26TeklaOpenAPIDrawingBasicTraining/CharlesPoolUserInterfaceandAttributesOpenDesignerViewforMainFormCreateneededtextorcomboboxesCreatenewalwaysForeachfieldsetthevaluesfortheTeklaStructuresattributes[Date]27TeklaOpenAPIDrawingBasicTraining/CharlesPoolOpenPluginAttributes.csForeachfieldinUIwithTeklaStructuresattributesset,createnewfieldsherethatmatch[Date]28CreatingActualDimensioninDrawingDimensionLogicTeklaOpenAPIDrawingBasicTraining/CharlesPoolMainlogicCodeforthissectionusunderthefolderTemplateLogicOpenBoltDimension.csStartwithCreateDimension()MethodNoticeargumentsfromPluginStartup[Date]29TeklaOpenAPIDrawingBasicTraining/CharlesPoolMainlogicforyoutoimplement:AddboltpointsfromgroupAddadditionalpickedpointfromuserSetupdimensiondirectionvectorsSetdistancepastobjectconstant:E.g.200mmCreatenewDimensionsethandlerwithattributesCreatenewXdirectiondimensionCreatenewYdirectiondimension[Date]30TeklaOpenAPIDrawingBasicTraining/CharlesPoolDimensionSetHanderTipsCreatinganewhandler:vardimSetHandler=newStraightDimensionSetHandler();Creatinganewsettingsobject:varsettings=newStraightDimensionSet.StraightDimensionSetAttr
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 餐饮店租赁与特色餐饮品牌授权合同
- 产业园区场地租赁合同终止及优惠政策协议
- 特色美食餐饮项目承包管理服务合同
- 常州房产中介独家代理二手房转让合同
- 插班生入学教育资助协议
- 2025年综合类-内科专业知识-心血管内科学历年真题摘选带答案(5卷单选100题合辑)
- 2025年综合类-传染病学(医学高级)-传染病学诊断学基础历年真题摘选带答案(5套单选100题合辑)
- 2025年综合类-临床医学检验技术(士)-医学原虫历年真题摘选带答案(5卷单选题百道集合)
- 2025年综合类-中西医结合儿科学-中医诊断学-问诊历年真题摘选带答案(5套单选100题合辑)
- 2025年综合类-中级水路运输-运输价格历年真题摘选带答案(5卷单选100题合辑)
- 《常见猪的品种》课件
- 2023初中历史教师进城选调考试模拟试题及答案(五套)
- 统编版语文八年级下册全册大单元教学整体分析
- DB21-T 2935-2018辽西北退化农田防护林修复技术规程
- 新厂建设投产总结汇报
- 精神病患者用药指导
- 《咖啡生豆烘焙》课件
- 工程检验检测机构安全培训
- 物资采购申购管理标准以及规范培训课件
- 妇产科医患沟通课件
- 单值-移动极差X-MR控制图-模板
评论
0/150
提交评论