SW-自动标注中心线宏代码

更新时间:2023-06-29 21:13:07 阅读: 评论:0

Sub main()
Set swApp = Application.SldWorks51劳动节
高三英语听力Set DrawingDoc = swApp.ActiveDoc
If DrawingDoc.GetType <> 3 Then Exit Sub
Set SelMgr = DrawingDoc.SelectionManager
If SelMgr.GetSelectedObjectType2(1) <> 12 Then Exit Sub
Set swview = SelMgr.GetSelectedObjectsDrawingView(1)
Set swDrawComp = swview.RootDrawingComponent
越南芽庄旅游攻略DrawingDoc.ActivateView swDrawComp.View.GetName2
Set Part = swview.ReferencedDocument
Set FeatObj = Part.FirstFeature
女鞋品牌排行
FeatObjname = FeatObj.GetTypeName
While FeatObjname <> "OriginProfileFeature"
Set FeatObj = FeatObj.GetNextFeature
FeatObjname = FeatObj.GetTypeName
Wend
Featname = FeatObj.Name
ViewOutlines = swview.GetOutline
ViewCXform = swview.GetXform
ViewXform = swview.GetViewXform
Hp1x = (ViewOutlines(0) - ViewCXform(0)) / ViewXform(12)
月球探索
贡缎Hp1y = ((ViewOutlines(1) + ViewOutlines(3)) / 2 - ViewCXform(1)) / ViewXform(12)
Hp2x = (ViewOutlines(2) - ViewCXform(0)) / ViewXform(12)
Hp2y = Hp1y
Vp1x = ((ViewOutlines(0) + ViewOutlines(2)) / 2 - ViewCXform(0)) / ViewXform(12)
Vp1y = (ViewOutlines(3) - ViewCXform(1)) / ViewXform(12)
Vp2x = Vp1x
Vp2y = (ViewOutlines(1) - ViewCXform(1)) / ViewXform(12)
DrawingDoc.SetAddToDB (True)
Set SkLineH = DrawingDoc.SketchManager.CreateCenterLine(Hp1x, Hp1y, 0, Hp2x, Hp2y, 0)
DrawingDoc.SketchAddConstraints "sgHORIZONTAL2D"
boolstatus = DrawingDoc.Extension.SelectByID2("Point1@" & Featname & "@" & swDrawComp.Name & "@" & swDrawComp.View.GetName2, "EXTSKETCHPOINT", 0, 0, 0, True, 0, Nothing, 0)
DrawingDoc.SketchAddConstraints "sgCOINCIDENT"
Set SkLineV = DrawingDoc.SketchManager.CreateCenterLine(Vp1x, Vp1y, 0, Vp2x, Vp2y, 0)
DrawingDoc.SketchAddConstraints "sgVERTICAL2D"
boolstatus = DrawingDoc.Extension.SelectByID2("Point1@" & Featname & "@" & swDrawComp.Name & "@" & swDrawComp.View.GetName2, "EXTSKETCHPOINT", 0, 0, 0, True, 0, Nothing, 0)
DrawingDoc.SketchAddConstraints "sgCOINCIDENT"
DrawingDoc.ClearSelection2 True
升旗感想
End Sub
粤语拼音对照表

本文发布于:2023-06-29 21:13:07,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/89/1060633.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:探索   越南   排行
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图