Inventor Customization

Reply
Member
s_kul
Posts: 3
Registered: ‎07-28-2011
Message 1 of 3 (196 Views)
Accepted Solution

Read workpoints and parts used to add dimension

196 Views, 2 Replies
07-28-2011 04:37 AM

I want to read the workpoints and parts used to add dimension in the drawing. Using VBA I can get workpoints using <Dimension>.IntentOne.Geometry.AttachedEntity. However I have not seen any way to read it in VB.NET. 

 

Can anybody please suggest me the way to read it?

ADN Support Specialist
xiaodong.liang
Posts: 1,264
Registered: ‎06-12-2011
Message 2 of 3 (187 Views)

Re: Read workpoints and parts used to add dimension

07-28-2011 08:52 PM in reply to: s_kul

Hi,

 

the similar code should be also work in VB.NET. did you get any error or failure? I used the following code, it works well to me. It is a code within a standalone application. It asks user to select a dimension and pop out the information of the attaced entity if it is a workpoint.

 

   Private Sub test()

        Dim m_inventorApp As Inventor.Application = Nothing
        Try
            m_inventorApp = System.Runtime.InteropServices.Marshal.GetActiveObject("Inventor.Application")
        Catch ex As Exception
        End Try

        ' Get a feature selection from the user
        Dim oObject As Object
        oObject = m_inventorApp.CommandManager.Pick(SelectionFilterEnum.kDrawingDimensionFilter, "Pick a dimension")

        If TypeOf oObject Is LinearGeneralDimension Then
            Dim oDrawDim As LinearGeneralDimension = oObject

            Dim oAttEntity As Object = oDrawDim.IntentOne.Geometry.AttachedEntity

            If TypeOf oAttEntity Is WorkPoint Then

                Dim oWP As WorkPoint = oAttEntity

                MsgBox("pt x,y,z" & oWP.Point.X & "; " & oWP.Point.Y & "; " & oWP.Point.Z)

            End If
        End If

    End Sub

 

 

 

Best regards,

 
autodesk_logo_signature.png

Xiaodong Liang

Developer Consultant

Autodesk Developer Technical Services



Xiaodong Liang
Developer Technical Services
Autodesk Developer Network

Member
s_kul
Posts: 3
Registered: ‎07-28-2011
Message 3 of 3 (172 Views)

Re: Read workpoints and parts used to add dimension

07-30-2011 01:51 AM in reply to: xiaodong.liang

Thank you.

 

This solution works for me.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community


Inventor Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Autodesk Inventor helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Inventor

Twitter

Facebook

Blogs

Pinterest

Youtube