Change drawing elements style & layer to "By Standard"?

Change drawing elements style & layer to "By Standard"?

bshbsh
Collaborator Collaborator
598 Views
5 Replies
Message 1 of 6

Change drawing elements style & layer to "By Standard"?

bshbsh
Collaborator
Collaborator

Is there a way to programmatically change the style and layer of different drawing elements (drawing curves, balloons, dimensions, revision tables, etc.) to "By Standard" (as if it was done using the dropdown menus)? I know how to change them to the style/layer specified by the active standard, but I want to change them to "by standard" so if I change the active standard of a drawing, they change automatically. Or can't this be done?

599 Views
5 Replies
Replies (5)
Message 2 of 6

frederic.vandenplas
Collaborator
Collaborator

Hi,

 

I know for sure that some elements needs to be deleted, and replaced (with possible dataloss)

for example, you need to do this with tables (parts list, ...)

If you think this answer fullfilled your needs, improved your knowledge or leads to a solution,
please feel free to "kudos"
0 Likes
Message 3 of 6

bshbsh
Collaborator
Collaborator

Yeah I know and I do that since I know no better way. That's why I asked. Is there really no way to do this through the API? Only through the gui?

 

0 Likes
Message 4 of 6

AJK2010
Enthusiast
Enthusiast

I am also looking for this function to set dimensions back to By Standard (xxxxxx).

Is there stil no solution?

0 Likes
Message 5 of 6

marcin_otręba
Advisor
Advisor

hi,

use:

            For i = 1 To odraw.StylesManager.DimensionStyles.Count
                If odraw.StylesManager.DimensionStyles.Item(i).UpToDate = False Then
                    odraw.StylesManager.DimensionStyles.Item(i).UpdateFromGlobal()
                End If
            Next
            For i = 1 To odraw.StylesManager.StandardStyles.Count
                If odraw.StylesManager.StandardStyles.Item(i).UpToDate = False Then
                    odraw.StylesManager.StandardStyles.Item(i).UpdateFromGlobal()
                End If
            Next
            For i = 1 To odraw.StylesManager.BalloonStyles.Count
                If odraw.StylesManager.BalloonStyles.Item(i).UpToDate = False Then
                    odraw.StylesManager.BalloonStyles.Item(i).UpdateFromGlobal()
                End If
            Next
            For i = 1 To odraw.StylesManager.CentermarkStyles.Count
                If odraw.StylesManager.CentermarkStyles.Item(i).UpToDate = False Then
                    odraw.StylesManager.CentermarkStyles.Item(i).UpdateFromGlobal()
                End If
            Next
            For i = 1 To odraw.StylesManager.FeatureControlFrameStyles.Count
                If odraw.StylesManager.FeatureControlFrameStyles.Item(i).UpToDate = False Then
                    odraw.StylesManager.FeatureControlFrameStyles.Item(i).UpdateFromGlobal()
                End If
            Next
            For i = 1 To odraw.StylesManager.HoleTableStyles.Count
                If odraw.StylesManager.HoleTableStyles.Item(i).UpToDate = False Then
                    odraw.StylesManager.HoleTableStyles.Item(i).UpdateFromGlobal()
                End If
            Next
            For i = 1 To odraw.StylesManager.LeaderStyles.Count
                If odraw.StylesManager.LeaderStyles.Item(i).UpToDate = False Then
                    odraw.StylesManager.LeaderStyles.Item(i).UpdateFromGlobal()
                End If
            Next
            For i = 1 To odraw.StylesManager.ObjectDefaultsStyles.Count
                If odraw.StylesManager.ObjectDefaultsStyles.Item(i).UpToDate = False Then
                    odraw.StylesManager.ObjectDefaultsStyles.Item(i).UpdateFromGlobal()
                End If
            Next
            For i = 1 To odraw.StylesManager.PartsListStyles.Count
                If odraw.StylesManager.PartsListStyles.Item(i).UpToDate = False Then
                    odraw.StylesManager.PartsListStyles.Item(i).UpdateFromGlobal()
                End If
            Next
            For i = 1 To odraw.StylesManager.RevisionTableStyles.Count
                If odraw.StylesManager.RevisionTableStyles.Item(i).UpToDate = False Then
                    odraw.StylesManager.RevisionTableStyles.Item(i).UpdateFromGlobal()
                End If
            Next
            For i = 1 To odraw.StylesManager.StandardStyles.Count
                If odraw.StylesManager.StandardStyles.Item(i).UpToDate = False Then
                    odraw.StylesManager.StandardStyles.Item(i).UpdateFromGlobal()
                End If
            Next
            For i = 1 To odraw.StylesManager.TableStyles.Count
                If odraw.StylesManager.TableStyles.Item(i).UpToDate = False Then
                    odraw.StylesManager.TableStyles.Item(i).UpdateFromGlobal()
                End If
            Next
            For i = 1 To odraw.StylesManager.TextStyles.Count
                If odraw.StylesManager.TextStyles.Item(i).UpToDate = False Then
                    odraw.StylesManager.TextStyles.Item(i).UpdateFromGlobal()
                End If
            Next
            For i = 1 To odraw.StylesManager.Layers.Count
                If odraw.StylesManager.Layers.Item(i).UpToDate = False Then
                    odraw.StylesManager.Layers.Item(i).UpdateFromGlobal()
                End If
            Next
            For i = 1 To odraw.StylesManager.Styles.Count
                If odraw.StylesManager.Styles.Item(i).UpToDate = False Then
                    odraw.StylesManager.Styles.Item(i).UpdateFromGlobal()
                End If
            Next

Hi, maybe you want to check my apps:


DrawingTools   View&ColoringTools   MRUFolders

0 Likes
Message 6 of 6

engilic
Advocate
Advocate

Hi, @bshbsh and @AJK2010 did you find the solution?

0 Likes