+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Full Member
    Computer Details
    WPerciful's Computer Details
    Operating System:
    Windows 7
    Discipline
    See details...
    WPerciful's Discipline Details
    Occupation
    Piping Designer
    Discipline
    See details below.
    Details
    Petro-Chem
    Using
    AutoCAD 2015
    Join Date
    Sep 2013
    Location
    Houston, TX
    Posts
    86

    Default Why is there an end of statement & expression expected

    Registered forum members do not see this ad.

    I've been using this code for years, and on the new SDK it now throws an end of statement expected and expression expected error. I'm not sure why this is now an issue whereas it hasn't been or how to resolve it.

    Code:
        <CommandMethod("test")>
    Public Sub test()
        Dim ps New Autodesk.AutoCAD.Windows.PaletteSet = Nothing
        ps = As New Autodesk.AutoCAD.Windows.PaletteSet("_")
        Dim dp As dtp = New dtp
        ps.Add("_", dp)
        ps.Visible = True
    End Sub
    Last edited by WPerciful; 3rd Oct 2017 at 12:41 pm.

  2. #2
    Super Moderator SLW210's Avatar
    Computer Details
    SLW210's Computer Details
    Operating System:
    Windows 7 PRO 64-bit
    Computer:
    IBM Lenovo
    Motherboard:
    ACPI x64
    CPU:
    Pentium(R) i5 4570 @ 3.2GHz
    RAM:
    8 GB RAM
    Graphics:
    Nvidia Quadro 600 1GB
    Primary Storage:
    300 GB
    Secondary Storage:
    650GB
    Monitor:
    2x ThinkVision 24"
    Discipline
    Multi-disciplinary
    SLW210's Discipline Details
    Occupation
    Design Draftsman
    Discipline
    Multi-disciplinary
    Details
    Mostly do drafting related to manufacturing. From doing site layouts with proposed updates, additions and renovations to be budgeted and submitted for bid, to updating and changing existing drawings to reflect maintenance and repair/revision work done on site.
    Using
    AutoCAD 2011
    Join Date
    May 2007
    Location
    South Florida, USA
    Posts
    11,738

    Default

    Please read the Code Posting Guidelines and edit your Code to be included in Code Tags.[CODE]Your Code Here[/CODE] =
    Code:
    Your Code Here
    “A narrow mind and a fat head invariably come on the same person” Zig Zigler



  3. #3
    Senior Member
    Discipline
    Civil
    Hippe013's Discipline Details
    Occupation
    Survey Crew Chief / Civil Designer
    Discipline
    Civil
    Details
    Land Survey / Civil Engineering
    Using
    Civil 3D 2017
    Join Date
    Feb 2010
    Location
    North Dakota
    Posts
    374

    Default

    The only thing that pops out at me is the lack of an underscore.

    Code:
       <CommandMethod("test")> _
    Public Sub test()

  4. #4
    Full Member
    Using
    AutoCAD 2010
    Join Date
    Oct 2013
    Posts
    78

    Default

    Registered forum members do not see this ad.

    I'm not a VB.NET-er so just some blind shots here about what's inside the test() sub

    Code:
    Public Sub test()
        Dim ps As Autodesk.AutoCAD.Windows.PaletteSet
        ps = New Autodesk.AutoCAD.Windows.PaletteSet("_")
        Dim dp As dtp = New dtp
        ps.Add("_", dp)
        ps.Visible = True
    End Sub
    and should what above ever work, may be some more contracted form would, too

    Code:
    Public Sub test()
        With New Autodesk.AutoCAD.Windows.PaletteSet("_")
            .Add("_", New dtp)
            .Visible = True
        End With
    End Sub

Similar Threads

  1. Trim not working as expected
    By OMEGA-ThundeR in forum AutoCAD 2D Drafting, Object Properties & Interface
    Replies: 9
    Last Post: 26th Jul 2017, 05:11 pm
  2. OBJECTSCALE not responding as expected
    By Glen1980 in forum AutoCAD 2D Drafting, Object Properties & Interface
    Replies: 5
    Last Post: 6th Sep 2016, 02:53 pm
  3. xref'd Architecture models not displaying as expected
    By Bogbadbob658 in forum Architecture & ADT
    Replies: 1
    Last Post: 12th Oct 2013, 12:56 pm
  4. subtract command not working like expected after import
    By jcc5018 in forum AutoCAD 3D Modelling & Rendering
    Replies: 12
    Last Post: 20th Apr 2013, 12:06 pm
  5. custom linetype doesn't work as expected
    By aglezb in forum AutoCAD 2D Drafting, Object Properties & Interface
    Replies: 1
    Last Post: 19th Apr 2012, 01:31 pm

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts