Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Dimensions of drawing view selection

1 REPLY 1
Reply
Message 1 of 2
raymaster
113 Views, 1 Reply

Dimensions of drawing view selection

Hello All

 

I need two main separate things:

1. a code that can select specific dimensions of a pre-named drawing view

2. a code that can add named annotations from assembly file to a specific pre-named view in a drawing document.

 

I tried to do it this way, but it selects all the dimensions:

Dim oDrawDoc As DrawingDocument
    oDrawDoc = ThisApplication.ActiveDocument

    Dim oViewName As String
    oViewName = "Master_SB"

    Dim oSheet As Sheet
    oSheet = oDrawDoc.ActiveSheet

    ' Get the dimensions collection for the specific view
    Dim oDimensions As DrawingDimensions
    oDimensions = oSheet.DrawingDimensions

    ' Process the dimensions (select only those in the "Master_SB" view)
    Dim oDrawDim As DrawingDimension
    For Each oDrawDim In oDimensions
        If oDrawDim.Parent.Name = oViewName Then
            oDrawDoc.SelectSet.Select(oDrawDim)
        End If
    Next

Best

1 REPLY 1
Message 2 of 2
A.Acheson
in reply to: raymaster

Hi @raymaster 

If you look at the parent of drawing dimesion it is a sheet object and not view name.

Syntax

DrawingDimension.Parent() As Sheet

 

See this post which explains other solved methods to identify relationships.

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report