Dimensions of drawing view selection

Dimensions of drawing view selection

raymaster
Contributor Contributor
145 Views
1 Reply
Message 1 of 2

Dimensions of drawing view selection

raymaster
Contributor
Contributor

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

0 Likes
146 Views
1 Reply
Reply (1)
Message 2 of 2

A.Acheson
Mentor
Mentor

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
0 Likes