Changing default settings

Changing default settings

Anonymous
Not applicable
289 Views
1 Reply
Message 1 of 2

Changing default settings

Anonymous
Not applicable

Is it possible to change the default settings for when you select a polygon during sketching? Currently it defaults to 6 sides. I would like mine to default to 3. I am guessing somewhere in the code there would be a setting for this or a way of changing it?

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

frederic.vandenplas
Collaborator
Collaborator

No it's not possible by default settings Smiley Sad

I managed to do it for creating a custom detail view with specific settings by using sendkeys (TAB/TAB/...)

This was written in .NET

Private Sub CustomDetailView_OnExecute(Context As NameValueMap) Handles CustomDetailView.OnExecute
            Try
                Dim oDrawDoc As DrawingDocument = InvApp.ActiveDocument
                Dim oDrawingView As DrawingView

                If oDrawDoc.ActiveSheet.DrawingViews.Count > 1 Then
                    oDrawingView = InvApp.CommandManager.Pick(SelectionFilterEnum.kDrawingViewFilter, "Select view.")
                Else
                    oDrawingView = oDrawDoc.ActiveSheet.DrawingViews.Item(1)
                End If
                oDrawDoc.SelectSet.Select(oDrawingView)

                Dim oCommandMgr As CommandManager = InvApp.CommandManager
                Dim oControlDef As ControlDefinition = oCommandMgr.ControlDefinitions("DrawingDetailViewCmd")
                Call oControlDef.Execute()

                SendKeys.SendWait("{TAB}")
                SendKeys.SendWait(My.Settings.ActualScale)
                SendKeys.SendWait("+{TAB}")
                SendKeys.SendWait("+{TAB}")
                SendKeys.SendWait("+{TAB}")
                SendKeys.SendWait("+{TAB}")
                SendKeys.SendWait("+{TAB}")
                SendKeys.SendWait("{RIGHT}")

            Catch ex As Exception
                MsgBox(Err.Description & " " & Err.Number)
            End Try

        End Sub

 So i've tried it for the polygon function too and this is the code in vba, you need to create a button on the ribbon, otherwise you will end with the sended key in your code 🙂

Sub CustomPolygon()
           
                Dim oCommandMgr As CommandManager
                Set oCommandMgr = ThisApplication.CommandManager
                Dim oControlDef As ControlDefinition
                Set oControlDef = oCommandMgr.ControlDefinitions("SketchPolygonCmd")
                Call oControlDef.Execute

                SendKeys "{3}"

End Sub

 

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