Visual LISP, AutoLISP and General Customization

Reply
Active Member
LightingDesignAlliance
Posts: 8
Registered: ‎06-07-2011
Message 1 of 6 (358 Views)
Accepted Solution

Lisp not working with 64bit stations

358 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



Distinguished Mentor
_Tharwat
Posts: 574
Registered: ‎07-02-2010
Message 2 of 6 (353 Views)

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

 

 

____________________________________________________
Get learn and learn and practice , to become experienced guy .
Active Member
LightingDesignAlliance
Posts: 8
Registered: ‎06-07-2011
Message 3 of 6 (345 Views)

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.
Distinguished Mentor
_Tharwat
Posts: 574
Registered: ‎07-02-2010
Message 4 of 6 (335 Views)

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))
  )
)

 

____________________________________________________
Get learn and learn and practice , to become experienced guy .
Valued Mentor
Shneuph
Posts: 311
Registered: ‎11-26-2007
Message 5 of 6 (317 Views)

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)
Active Member
LightingDesignAlliance
Posts: 8
Registered: ‎06-07-2011
Message 6 of 6 (303 Views)

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

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community