Results 1 to 4 of 4

Thread: Issues with LispFunction ACAD2019 vb.net

  1. #1
    Active Member nelson's Avatar
    Join Date
    2015-11
    Location
    Portland, MI
    Posts
    90
    Login to Give a bone
    0

    Default Issues with LispFunction ACAD2019 vb.net

    I'm not sure what is going on, we have a few LispFunctions that are not working in new documents. This started sometime after I updated my code to .Net 4.7 for acad2019. I went back to the most basic steps and used the code from Autodesk's site about AutoLisp

    The issue is that it will work in the drawing session that opens when I launch AutoCAD, but any other document (dwg) that I open it doesn't recognize the code. All I get is "; error: no function definition: " It's like it isn't looking at the active document or something...?

    All I want to do is get my button commands working again. This was a simple ^C^C(command "arg") setup. I'm trying to cleanup most of our lisps to work in Vb.net so I need to be able to pass arguments in with the lisp call. I'd prefer not to rewrite the code to a bunch of individual commandmethods if possible. If LispFunction is not functioning correctly, is there something else that works to pass arguments into a command?

  2. #2
    Programming Moderator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,499
    Login to Give a bone
    0

    Default Re: Issues with LispFunction ACAD2019 vb.net

    Hard to help without seeing the code.

    How are you loading the .NET assembly & how are your LispFunction methods instantiated?

    The fact that it works in the first document following Initialize() might suggest that you're missing subsequent calls to load same on DocumentCreated event.

    Cheers
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3620, Core i7-7700K 4.2GHz, 64GB RAM, Samsung 970 Pro M.2, 8GB NVIDIA Quadro P4000

  3. #3
    Active Member nelson's Avatar
    Join Date
    2015-11
    Location
    Portland, MI
    Posts
    90
    Login to Give a bone
    0

    Default Re: Issues with LispFunction ACAD2019 vb.net

    I have this all in a custom company plugin, but that is removed and I'm just doing a netload to load the dll.
    As far as instantiating the lispfunction, I'm just doing command line entry to eliminate anything else (lisptest "2")

    Code:
            <LispFunction("LispTest")>
            Public Function LispTest(ByVal args As ResultBuffer) As Double
    
                If Not args = Nothing Then
                        Dim value As Double
                        If Double.TryParse(args.AsArray()(0).Value.ToString(), value) Then
                        MsgBox("Arg Value = " & value)
                        Application.DocumentManager.MdiActiveDocument.Editor.WriteMessage(vbLf & value & vbLf)
                        End If
                        Return value
                    End If
    
            End Function
    All other commandmethods are working fine in all documents, it's just this pesky lispfunction not working in all active drawings. I use it for a few buttons in the ribbon to carry argument.
    Last edited by BlackBox; 2019-02-19 at 09:10 PM. Reason: Please use [CODE] Tags

  4. #4
    Programming Moderator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,499
    Login to Give a bone
    0

    Default Re: Issues with LispFunction ACAD2019 vb.net

    Quote Originally Posted by nelson View Post
    I have this all in a custom company plugin, but that is removed and I'm just doing a netload to load the dll.
    As far as instantiating the lispfunction, I'm just doing command line entry to eliminate anything else (lisptest "2")

    Code:
            <LispFunction("LispTest")>
            Public Function LispTest(ByVal args As ResultBuffer) As Double
    
                If Not args = Nothing Then
                        Dim value As Double
                        If Double.TryParse(args.AsArray()(0).Value.ToString(), value) Then
                        MsgBox("Arg Value = " & value)
                        Application.DocumentManager.MdiActiveDocument.Editor.WriteMessage(vbLf & value & vbLf)
                        End If
                        Return value
                    End If
    
            End Function
    All other commandmethods are working fine in all documents, it's just this pesky lispfunction not working in all active drawings. I use it for a few buttons in the ribbon to carry argument.
    Again, given that the issue is with the implementation, pseudo-code isn't very helpful.

    What's in your Initialize() method?
    Last edited by BlackBox; 2019-02-19 at 09:51 PM.
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3620, Core i7-7700K 4.2GHz, 64GB RAM, Samsung 970 Pro M.2, 8GB NVIDIA Quadro P4000

Similar Threads

  1. Define LispFunction dynamically
    By irneb in forum Dot Net API
    Replies: 7
    Last Post: 2010-04-02, 06:12 AM
  2. Map issues
    By tim.101799 in forum Revit - Rendering
    Replies: 1
    Last Post: 2008-11-17, 09:01 PM
  3. Autodesk Issues Tech Bulletin: Service Issues Affecting Revit9-Based Software
    By jobcaptain in forum Revit - Known Issues & Work-Arounds (Read only)
    Replies: 0
    Last Post: 2006-05-02, 04:25 AM
  4. 3d dwf issues
    By Andre Baros in forum Revit Architecture - General
    Replies: 1
    Last Post: 2005-07-15, 05:31 PM
  5. 7.0 Issues
    By Jarod in forum Revit Architecture - General
    Replies: 8
    Last Post: 2004-11-03, 03:39 AM

Posting Permissions

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