• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    Visual LISP, AutoLISP and General Customization

    Reply
    Active Member
    LightingDesignAlliance
    Posts: 8
    Registered: ‎06-07-2011
    Accepted Solution

    Lisp not working with 64bit stations

    293 Views, 5 Replies
    06-23-2011 03:05 PM

    I have a lisp that is pulling annotations from one block and assigning them as fields in another block, seems to work fine on 32bit stations but returns #### in the fields for 64bit stations.

     

    Thanks in advance

    

    Please use plain text.
    Valued Mentor
    _Tharwat
    Posts: 460
    Registered: ‎07-02-2010

    Re: Lisp not working with 64bit stations

    06-23-2011 03:43 PM in reply to: LightingDesignAlliance

    Without even taking a look the problem is with the object id .

     

    Tharwat

     

     

    Please use plain text.
    Active Member
    LightingDesignAlliance
    Posts: 8
    Registered: ‎06-07-2011

    Re: Lisp not working with 64bit stations

    06-23-2011 09:07 PM in reply to: LightingDesignAlliance
    Can you tell ne how to fix, I am a lisp novice.
    Please use plain text.
    Valued Mentor
    _Tharwat
    Posts: 460
    Registered: ‎07-02-2010

    Re: Lisp not working with 64bit stations

    06-24-2011 12:32 AM in reply to: LightingDesignAlliance

    Add the following codes by Gile to your codes to get the ObjectID .

     

    (defun gc:GetObjectIdString ( obj )
      (or *util* (setq *util* (vla-get-Utility (vla-get-ActiveDocument (vlax-get-acad-object)))))
      (if (vlax-method-applicable-p *util* 'GetObjectIdString)
        (vla-GetObjectIdString *util* obj :vlax-false)
        (itoa (vla-get-ObjectId obj))
      )
    )

     

    Please use plain text.
    Valued Mentor
    Posts: 299
    Registered: ‎11-26-2007

    Re: Lisp not working with 64bit stations

    06-24-2011 10:00 AM in reply to: LightingDesignAlliance

    The Code you posted has (rtos objID 2 0).  Is the object ID ever a real?  I think it's integer..

    Try switching:

     

    (setq
          obj   (vlax-ename->vla-object ent)
          objID (vla-get-objectid obj)
          str (strcat "%<\\AcObjProp Object(%<\\_ObjId "(rtos objID 2 0)">%).TextString \\f \"%tc1\">%")
        )

     

    in your code to:

     

    (setq
          obj   (vlax-ename->vla-object ent)
          objID (vla-get-objectid obj)
          str (strcat "%<\\AcObjProp Object(%<\\_ObjId "(itoa objID)">%).TextString \\f \"%tc1\">%")
        )

     

    I don't have a 64bit sys to test on..

     

    Next step would be to make the field manually on the 64 bit system and then check the string to make sure what you have in your lisp matches it I would think.

     

    Then you may have to use a different value for 'str depending on if the system is 32 or 64 bit (if possible)

    ---sig---------------------------------------
    '(83 104 110 101 117 112 104 64 71 109 97 105 108 46 99 111 109)
    Please use plain text.
    Active Member
    LightingDesignAlliance
    Posts: 8
    Registered: ‎06-07-2011

    Re: Lisp not working with 64bit stations

    06-24-2011 10:37 AM in reply to: Shneuph
    I added both to the lisp and I am now getting the correct data returned on my fields. Thank you both so much for the help. -Jason
    Please use plain text.