Announcements
Due to scheduled maintenance, the Autodesk Community will be inaccessible from 10:00PM PDT on Oct 16th for approximately 1 hour. We appreciate your patience during this time.
.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

DIMSTYLE RESTORE in SendTOString

0 REPLIES 0
Reply
Message 1 of 1
Anonymous
382 Views, 0 Replies

DIMSTYLE RESTORE in SendTOString

Hi All,

 

We have a .NET Code written for AutoCAD 2014, which displays dimension as below :

 

 

    Public Shared Sub add_dim(ByVal args As ResultBuffer) ' (defun add_dim (val mod / olderr)

        Dim ArgsArray As Array
        ArgsArray = args.AsArray  'Storing the Arugement list as array

        Dim val As String = CType(ArgsArray.GetValue(0), TypedValue).Value
        Dim mod_value As String = CType(ArgsArray.GetValue(1), TypedValue).Value

        ACADSysVarMgr.save_sysvars() '   (SAVE_SYSVARS) 
        Application.DocumentManager.MdiActiveDocument.Editor.WriteMessage(vbLf + "DIM") '(princ "\nDIM")
        If (GenFun.WCMATCH(Application.GetSystemVariable("ACADVER"), "14*,15*,16*,19*,22*")) = True Then '   (if (wcmatch (getvar "acadver") "14*,15*,16*") ; R14, 15 & 16 dimension
            GenFun.GetEditor.Document.SendStringToExecute("-toolbar dimension show " + vbCrLf, True, False, True) '  '       (command "-toolbar" "dimension" "show") )
        End If

        Dim get_dimstyle = Nimcad.get_dimstyle(mod_value)
        GenFun.GetEditor.Document.SendStringToExecute("DIM restore " + get_dimstyle + " " + vbCrLf, True, False, True) '   (command "DIM" "restore" (GET_DIMSTYLE mod)) ;"ATTDIM") ; Restore Dim Style.

        If (val = Nothing And (GenFun.WCMATCH(Application.GetSystemVariable("ACADVER"), "14*,15*,16*,19*,22*"))) Then  '   (cond ((and (not val) (wcmatch (getvar "acadver") "14*,15*,16*")) ; R14, 15 & 16 dimension
            GenFun.GetEditor.Document.SendStringToExecute(vbCr + " exit dimlinear ", True, False, True)  ' (command "exit" "dimlinear")
        ElseIf val = Nothing Then  ' ((not val) t) ; User selects dim type.
            GenFun.GetEditor.Document.SendStringToExecute(vbCr + " exit dimlinear ", True, False, True)
        ElseIf val = "L" Then
            GenFun.GetEditor.Document.SendStringToExecute(vbCr + " LEADER ", True, False, True) '         ((wcmatch val "L") (command "LEADER"))    ; Leader line mode.
        ElseIf val = "H" Then
            GenFun.GetEditor.Document.SendStringToExecute(vbCr + " HOR ", True, False, True) '         ((wcmatch val "H") (command "HOR"))  ; Horozontal dimensions.
        ElseIf val = "V" Then
            GenFun.GetEditor.Document.SendStringToExecute(vbCr + " VERT ", True, False, True) '         ((wcmatch val "V") (command "VERT"))    ; Vertical dimensions.
        End If
        ACADSysVarMgr.reset_sysvars() '   (RESET_SYSVARS)
    End Sub

 

 

But according to the below link DIM RESTORE should be replaced by -DIMSTYLE RESTORE command for it to work in AutoCAD 2016 and higher. We are converting the code to AutoCAD 2018.

https://knowledge.autodesk.com/support/autocad/troubleshooting/caas/sfdcarticles/sfdcarticles/Dimsty...

Could anybody help me in converting the above to work with AutoCAD 2018?

 

Thanks in Advance

0 REPLIES 0

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

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report