获取焊缝的轮廓
来源:互联网 发布:java 多线程 锁 编辑:程序博客网 时间:2024/04/30 06:30
有客户问道如何得知焊缝的轮廓,其实WeldBead.BeadFaces 就返回焊缝的每个面,根据它们就能得知焊缝的轮廓。以下代码将这些面用Client Graphics的形式体现出来,为了和焊缝本身区分,故意将其偏移了一些位置。
Public Sub test() 'get document and definition Dim oDoc As AssemblyDocument Set oDoc = ThisApplication.ActiveDocument Dim oCompDef As AssemblyComponentDefinition Set oCompDef = oDoc.ComponentDefinition 'if this is a weld document If oCompDef.Type = kWeldmentComponentDefinitionObject Then Dim wcd As WeldmentComponentDefinition Set wcd = oCompDef Else Exit Sub End If ' get one weld bead Dim oWB As WeldBead Set oWB = wcd.Welds.WeldBeads(1) On Error Resume Next Dim oClientGraphics As ClientGraphics Set oClientGraphics = oCompDef.ClientGraphicsCollection.Item("weldbead") If Err.Number = 0 Then 'delete the older client graphics, if any On Error GoTo 0 oClientGraphics.Delete ThisApplication.ActiveView.Update End If Err.Clear On Error GoTo 0 ' create a client graphics Set oClientGraphics = oCompDef.ClientGraphicsCollection.Add("weldbead") 'add graphics node Dim oSurfacesNode As GraphicsNode Set oSurfacesNode = oClientGraphics.AddNode(1) 'add the face of WeldBead.BeadFaces Dim oSurfaceGraphics As SurfaceGraphics Dim oEachWeldFace As Face For Each oEachWeldFace In oWB.BeadFaces Set oSurfaceGraphics = oSurfacesNode.AddSurfaceGraphics(oEachWeldFace) Next 'set graphics' color. assume “Magenta” exists in the document oSurfacesNode.Appearance = oDoc.Assets("Magenta") 'transform the client graphics to a location Dim oTransGeom As TransientGeometry Set oTransGeom = ThisApplication.TransientGeometry Dim oV As Vector Set oV = oTransGeom.CreateVector(10, 10, 10) Dim oM As Matrix Set oM = oTransGeom.CreateMatrix() Call oM.SetTranslation(oV) oSurfacesNode.Transformation = oM 'update the view ThisApplication.ActiveView.UpdateEnd Sub
0 0
- 获取焊缝的轮廓
- opencv 获取手势的轮廓
- opencv 获取手势的轮廓
- opencv 获取手势的轮廓
- matlab获取图像的轮廓
- 查找轮廓并获取最大轮廓的所有点
- 获取特征的轮廓草图实体
- 获取轮廓线上的点坐标
- 获取轮廓的最小外接矩形
- 获取轮廓内图像
- opencv获取轮廓
- 图像轮廓获取opencv
- JNI获取Bitmap轮廓
- 获取最大轮廓 opencv
- 获取轮廓深度
- ArcGIS教程:获取建筑物轮廓线的高程信息
- OpenCV提取轮廓的方法获取瞳孔区域及中心
- 使用OpenCV的findContours获取轮廓并切割(python)
- Expression Blend实例中文教程(13) - 控件模板快速入门ControlTemplates
- Android App Widget设计
- 【Android 应用开发】AndroidUI设计 之 图片浏览器
- Oracle10g客户端连接远程数据库配置图解
- HAProxy 淘宝 实时在线聊天所用的负载
- 获取焊缝的轮廓
- fragment + fragmentTabHost实现底部菜单与自定义fragment管理
- u-boot-2012.07 for FL2440
- map/reduce 下ArrayWritable 的使用
- How to get Json in Android
- XCode Debugger中的Icon符号的意义[转自:唐巧的技术博客]
- 润乾——全局样式
- 将 Linq to SQl 项目移植到 Linq to Oracle
- RMAN简明使用手册(转载)