皮皮网

【jsp easyui 管理 系统 源码】【强势调整指标源码】【winform简单界面源码】vba acad源码

时间:2024-12-29 07:43:43 来源:图像比特增强源码

1.VB.Net读取AutoCAD图纸
2.cad vba 样条曲线坐标

vba acad源码

VB.Net读取AutoCAD图纸

       å¦‚果可以的话请把分给我

       ã€€ã€€ä»¥ä¸‹æ˜¯cad版的,引用autocad type library 和autocad/objectdbx common 如果是或者版本更低的只要引用autocad type library,代码的话大同小异,思路是一样的

 

       ã€€ã€€

           Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

               On Error Resume Next

               Dim acadapp As Autodesk.AutoCAD.Interop.AcadApplication

               acadapp = GetObject(vbNullString, "autoCAD.application")

               Dim acaddoc As Autodesk.AutoCAD.Interop.AcadDocument

               acaddoc = acadapp.ActiveDocument

               Dim Ms As Autodesk.AutoCAD.Interop.Common.AcadModelSpace

               Ms = acaddoc.ModelSpace

               Dim acadObjectI As Autodesk.AutoCAD.Interop.Common.AcadObject

               Dim Linei As Autodesk.AutoCAD.Interop.Common.AcadLine

               Dim Circlei As Autodesk.AutoCAD.Interop.Common.AcadCircle

               Dim Polylinei As Autodesk.AutoCAD.Interop.Common.AcadPolyline

               Dim pt As Autodesk.AutoCAD.Interop.Common.AcadPoint

               For Each acadObjectI In Ms

                   Debug.Print(acadObjectI.ObjectName)

                   Select Case acadObjectI.ObjectName

                       Case "AcDbLine"

                           Linei = acadObjectI

                           Debug.Print("X =" & Linei.StartPoint(0).ToString)

                           Debug.Print("Y =" & Linei.StartPoint(1).ToString)

                       Case ""

                       Case ""

                   End Select

               Next

           End Sub

cad vba 样条曲线坐标

       简单:首先要选择该样条曲线方法有两种,我就说说简单的jsp easyui 管理 系统 源码一种!

       Sub www()

        Dim myspl As AcadSpline

        Dim selobj As Object

        Dim ppt As Variant

        ’以下do while 语句仅仅是强势调整指标源码为了避免选择样条曲线时出错。如若简单点的winform简单界面源码话可以改成

        'ThisDrawing.Utility.GetEntity selobj, ppt, "请选择样条曲线"

        'Set myspl = selobj

        Do While code = 0

        On Error Resume Next

        ThisDrawing.Utility.GetEntity selobj, ppt, "请选择样条曲线"

        If Err <> 0 Then

        Err.Clear

        ThisDrawing.Utility.Prompt " 没有选定样条曲线对象,退出"

        Exit Sub

        End If

        If Err.Number = 0 Then

        If (selobj.EntityName = "AcDbSpline") Then

        Set myspl = selobj ‘将获取的曲线赋给变量myspl

        Exit Do

        End If

        Err.Clear

        End If

        Loop

        Dim np As Integer

        Dim pl() As Double

        Dim pt As Variant

        np = myspl.NumberOfFitPoints ’获取样条曲线的点数

        ReDim pl(0 To np * 3 - 1)

        Open "c:\1.txt" For Output As #1

        For i = 0 To np - 1

        pt = myspl.GetFitPoint(i) ‘获取样条曲线第i个点

        For j = 0 To 2

        pl(i * 3 + j) = pt(j)

        Next

        Print #1, pt(0), pt(1), pt(2) ’输出样条曲线的点坐标到.txt中

        Next

        ThisDrawing.ModelSpace.Add3DPoly pl ‘ 将样条曲线的点连成多段线

        Close #1

        ZoomAll

       End Sub

推荐资讯
高雄民宅瓦斯氣爆1死多人受傷 不排除遭縱火

高雄民宅瓦斯氣爆1死多人受傷 不排除遭縱火

日本福島縣附近發生4.9級地震

日本福島縣附近發生4.9級地震

【書評】《噤聲之界:北臺灣客庄與原民的百年纏結和對話》:換位思考與複數性真實史觀

【書評】《噤聲之界:北臺灣客庄與原民的百年纏結和對話》:換位思考與複數性真實史觀

列对象、定措施、惩违法!辽宁开展固体饮料等食品专项整治

列对象、定措施、惩违法!辽宁开展固体饮料等食品专项整治

在敘華人:家裏僅剩一排雞蛋,每人中午吃兩個裹腹

在敘華人:家裏僅剩一排雞蛋,每人中午吃兩個裹腹

無所畏懼「未來大人物」叛逆的關鍵字:突破框架、自我認同、挑戰極限

無所畏懼「未來大人物」叛逆的關鍵字:突破框架、自我認同、挑戰極限

copyright © 2016 powered by 皮皮网   sitemap