首页 > 编程语言 >Aveva Marine VBNET 编程系列-创建曲线

Aveva Marine VBNET 编程系列-创建曲线

时间:2023-09-30 09:12:09浏览次数:42  
标签:Dim Geometry Marine draftApp Aveva New VBNET

显现的效果

 

代码实现:

<MyAmFunctionAtt(NameOf(绘图控制), NameOf(新建曲线))>
    Public Sub 新建曲线(wm As WindowManager)
        Dim draftApp As New MarDrafting
        Dim ui As New MarUi 'Imports Aveva.Marine.UI
        Dim utily As New MarUtil 'Imports Aveva.Marine.Utility
        Try
            If Not draftApp.DwgCurrent() Then
                MsgBox("未开启任何图纸无法新建曲线", MsgBoxStyle.Critical, "错误提示")
                Return
            End If
            Dim str As New MarStringlist("绘直线")
            str.AddString("绘制圆")
            str.AddString("绘制矩形")
            Dim rtns = ui.ChoiceSelect("选择操作", "选择曲线类型", str)
            If rtns(0) = utily.Ok() Then
                Dim hd As MarElementHandle = Nothing
                Select Case rtns(1)
                    Case 1
                        hd = draftApp.LineNew(New Aveva.Marine.Geometry.MarRlinePlanar(
                            New Aveva.Marine.Geometry.MarPointPlanar(10, 20),
                             New Aveva.Marine.Geometry.MarPointPlanar(100, 50)
                                         ))
                    Case 2
                        hd = draftApp.CircleNew(
                            New Aveva.Marine.Geometry.MarCirclePlanar(
                            New Aveva.Marine.Geometry.MarPointPlanar(10, 20), 500
                                         ))
                    Case 3
                        hd = draftApp.RectangleNew(
                            New Aveva.Marine.Geometry.MarRectanglePlanar(
                            New Aveva.Marine.Geometry.MarPointPlanar(10, 20), New Aveva.Marine.Geometry.MarPointPlanar(100, 50)
                                         ))
                End Select
                draftApp.ElementColourSet(hd, New MarColour("Cyan"))
            End If
        Catch ex As Exception
            MsgBox(ex.StackTrace)
        Finally
            draftApp.Dispose()
            ui.Dispose()
            utily.Dispose()
        End Try
    End Sub

 

标签:Dim,Geometry,Marine,draftApp,Aveva,New,VBNET
From: https://www.cnblogs.com/NanShengBlogs/p/17737604.html

相关文章

  • Aveva Marine VBNET 编程系列-新建图纸,创建文字
    根据MarApi,创建图形文件,新建文字ImportsAveva.ApplicationFramework.PresentationImportsAveva.Marine.Drafting'marAPI.dllPublicClass绘图控制<MyAmFunctionAtt(NameOf(绘图控制),NameOf(新建图纸))>PublicSub新建图纸(wmAsWindowManager)Di......
  • Aveva Marine VBNET 编程系列-修改程序快捷键
    修改HullDesign程序的主题以及菜单项的快捷键 引用的dll文件下面的是代码和快捷键配置文件:https://files.cnblogs.com/files/NanShengBlogs/AMShortCut.HullDesign.zip?t=1695908179&download=trueImportsAveva.ApplicationFramework.PresentationImportsAveva.Applic......
  • Aveva Marine VBNET 编程系列-搭建开发框架
    引用的DllAveva.ApplicationFramework.dllAveva.ApplicationFramework.Presentation菜单展示效果创建Attribute,用于反射来动态创建菜单,不用每次都去写commandPublicClassMyAmFunctionAttInheritsAttributePrivate_menuNameAsStringPublicPropertyM......
  • VBNET AUTOCAD 单行文字OBB有向包围盒的计算
    遇到要求单行文字包围和的需求,发现AutoCAD自带的算法仅能求出正交包围盒,如下图所示的粉色矩形我想获取下图下图所示蓝色矩形的部分及OBB计算方法图形示例:下面是完整的代码,其中求D点的坐标p1涉及到向量定比分点公式<CommandMethod(NameOf(TT_SingleTextOBB))>SubTT......
  • Tokio Marine & Nichido Fire Insurance Programming Contest 2020
    A-Nickname直接输出前三个字符。代码:#include<iostream>#include<cstdio>usingnamespacestd;constintN=25;chars[N];intmain(){ scanf("%s",s+1); printf("%c%c%c",s[1],s[2],s[3]); return0;}B-Tag如果\(v\leqw\),则显然不......
  • c# aveva marine link folder
    publicclassLinkWorld{publicstaticDbElementLinkWLD=>Aveva.Pdms.Database.DbType.Design.FindElements(DbElementTypeInstance.LINKWLD).FirstOrDefault();}publicclassLinkDescription{publicDbElementCurElement{g......
  • Submarine Spark Security Plugin介绍(0.6.0版本)
    参考https://submarine.apache.org/zh-cn/docs/0.6.0/userDocs/submarine-security/spark-security/从ranger的github地址https://github.com/apache/ranger中可以发现当......
  • c# aveva marine 批量导出图纸到dxf格式
    获取图纸数据库查看代码publicstaticDictionary<string,List<DbElement>>GetDbElements(DbTypedbtype){Dictionary<string,List<DbElement......
  • C# AVEVA PDMS 修改快捷键
    修改快捷键和提示文件 提取菜单栏按钮publicstaticList<ButtonToolImpl>GetButtonImpls(thisMenuToolImplmtl){List<ButtonT......