Author Topic: ** Error: no function definition: VLA-GET-OBJECTID32 **  (Read 12946 times)

0 Members and 1 Guest are viewing this topic.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: ** Error: no function definition: VLA-GET-OBJECTID32 **
« Reply #30 on: April 25, 2014, 11:26:02 AM »
Damn. I have to get AutoCAD 2015 installed. :police:

Thanks for letting me know Ron.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

ronjonp

  • Needs a day job
  • Posts: 7529
Re: ** Error: no function definition: VLA-GET-OBJECTID32 **
« Reply #31 on: April 25, 2014, 11:32:42 AM »
Glad to help  8)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: ** Error: no function definition: VLA-GET-OBJECTID32 **
« Reply #32 on: April 25, 2014, 11:36:41 AM »
Regardless that vla-setblocktablerecordid will accept a string ... given that vla-get-objectid returns an int aren't you tempted to return same from your alt?
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

ronjonp

  • Needs a day job
  • Posts: 7529
Re: ** Error: no function definition: VLA-GET-OBJECTID32 **
« Reply #33 on: April 25, 2014, 02:13:07 PM »
Regardless that vla-setblocktablerecordid will accept a string ... given that vla-get-objectid returns an int aren't you tempted to return same from your alt?


That would probably be a good idea.


Would you know why (atoi "140694991308416") returns 2147483647 ?

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC


ribarm

  • Gator
  • Posts: 3274
  • Marko Ribar, architect
Re: ** Error: no function definition: VLA-GET-OBJECTID32 **
« Reply #35 on: April 25, 2014, 02:33:36 PM »
Would you know why (atoi "140694991308416") returns 2147483647 ?

Probably, because there are 16^8 integers...

Code: [Select]
Command: (fix (atof (rtos (/ (- (expt 16. 8) 1) 2))))
2147483647
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: ** Error: no function definition: VLA-GET-OBJECTID32 **
« Reply #36 on: April 25, 2014, 04:31:59 PM »
I'm not at my computer (road trip ftw) but my inclination would be to use read, anyone try that?
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

ronjonp

  • Needs a day job
  • Posts: 7529
Re: ** Error: no function definition: VLA-GET-OBJECTID32 **
« Reply #37 on: April 25, 2014, 11:07:22 PM »
Read does not work either.

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: ** Error: no function definition: VLA-GET-OBJECTID32 **
« Reply #38 on: April 26, 2014, 12:15:14 AM »
How about distof?
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

ronjonp

  • Needs a day job
  • Posts: 7529
Re: ** Error: no function definition: VLA-GET-OBJECTID32 **
« Reply #39 on: April 26, 2014, 08:47:45 AM »
Distof returns the same value as read  :(

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: ** Error: no function definition: VLA-GET-OBJECTID32 **
« Reply #40 on: April 26, 2014, 09:17:43 AM »
Thanks for trying Ron.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: ** Error: no function definition: VLA-GET-OBJECTID32 **
« Reply #41 on: April 26, 2014, 11:16:50 AM »
As discussed previously, I believe the atoi method won't work as the integer conversion functions in AutoLISP are only compatible with 32-bit signed integers and the 64-bit method requires a Long rather than an Int.

This link seems to describe the changes made to the ActiveX API in 2015:

http://help.autodesk.com/view/ACD/2015/ENU/?guid=GUID-6FEDBCCA-91D0-4782-AE5A-49BD4384FD8C

Though, its odd that the setblocktablerecordid method now accepts either a 32-bit integer or a string for 64-bit systems - certainly, this behaviour is not detailed in the documentation.

With these changes in mind, and to retain compatibility with earlier 64-bit systems, I would suggest perhaps:
Code: [Select]
(defun LM:objectid ( obj )
    (eval
        (list 'defun 'LM:objectid '( obj )
            (cond
                (   (not (wcmatch (getenv "PROCESSOR_ARCHITECTURE") "*64*"))
                   '(vla-get-objectid obj)
                )
                (   (= 'subr (type vla-get-objectid32))
                   '(vla-get-objectid32 obj)
                )
                (   (list 'vla-getobjectidstring (vla-get-utility (LM:acdoc)) 'obj ':vlax-false))
            )
        )
    )
    (LM:objectid obj)
)

(defun LM:acdoc nil
    (eval (list 'defun 'LM:acdoc 'nil (vla-get-activedocument (vlax-get-acad-object))))
    (LM:acdoc)
)

But unfortunately I don't have access to a 64-bit system for testing. :(
« Last Edit: April 26, 2014, 11:21:51 AM by Lee Mac »

chlh_jd

  • Guest
Re: ** Error: no function definition: VLA-GET-OBJECTID32 **
« Reply #42 on: April 26, 2014, 03:37:20 PM »
Nice solution , Lee :-)
In my case : In Acad2011 64bit system , Object has two property about ID <ObjectID32> <ObjectID>
                   In Acad2015 64bit system , Object has only one ID <ObjectID>
Code: [Select]
(vl-load-com)
(defun _ObjectID  (OBJ / ID)
  (vl-catch-all-apply
    (function
      (lambda nil
(setq ID
       (vlax-get
obj
(quote objectid)))))) id)
;;For test
(_ObjectID (vlax-ename->vla-object (car (entsel))))

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: ** Error: no function definition: VLA-GET-OBJECTID32 **
« Reply #43 on: April 26, 2014, 03:47:06 PM »
Nice solution , Lee :-)

Thanks chlh_jd  :-)

In my case : In Acad2011 64bit system , Object has two property about ID <ObjectID32> <ObjectID>
                   In Acad2015 64bit system , Object has only one ID <ObjectID>

If I've understood the API change correctly, the objectid property in 64-bit versions < 2015 (maybe 2014 also?) will return an incorrect object ID, and the objectid32 property must be used instead for these systems.

Could anyone confirm whether the value returned by the objectid property in 64-bit 2015 can be used with the setblocktablerecordid method?


chlh_jd

  • Guest
Re: ** Error: no function definition: VLA-GET-OBJECTID32 **
« Reply #44 on: April 26, 2014, 03:53:37 PM »
If I've understood the API change correctly, the objectid property in 64-bit versions < 2015 (maybe 2014 also?) will return an incorrect object ID, and the objectid32 property must be used instead for these systems.
Could anyone confirm whether the value returned by the objectid property in 64-bit 2015 can be used with the setblocktablerecordid method?

I has catch this case sometime in AutoCAD2011 , but didn't know when it come in correct , perhaps I'v update it or .Net Frame .