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

0 Members and 1 Guest are viewing this topic.

Lee Mac

  • Seagull
  • Posts: 12905
  • London, England
Re: ** Error: no function definition: VLA-GET-OBJECTID32 **
« Reply #15 on: April 10, 2014, 01:43:49 PM »
Give this version a try .. seems to be working on my computer. I noted the change in the header.

Ron -

As noted, I unfortunately don't have access to a 64-bit system to test, so I was curious: based on your modifications to the code, does the setblocktablerecordid32 accept a string representation of the 64-bit object ID (as returned by the getobjectidstring method)?

Also, why is the (= (type vla-get-objectid32) 'subr) test not sufficient to cater for 2014 onwards?

Many thanks,

Lee

ronjonp

  • Needs a day job
  • Posts: 7526
Re: ** Error: no function definition: VLA-GET-OBJECTID32 **
« Reply #16 on: April 10, 2014, 03:02:23 PM »
Lee,


From my testing, the setblocktablerecordid32 chucks a wobbly with the x64 objectID string.

Quote
_$
_1$
'(vlax-invoke #<VLA-OBJECT IAcadTable 000000002e0bd7f8> SETBLOCKTABLERECORDID32 2 0 "140700197868736" :vlax-true)
_1$
** Error: Out of present range **; reset after error


This test is fine (= (type vla-get-objectid32) 'subr) ... perhaps the function below will suffice :)

Code: [Select]

(defun _getobjectid (doc obj)
  (if (vl-string-search "64" (getenv "PROCESSOR_ARCHITECTURE"))
    (if (= (type vla-get-objectid32) 'subr)
      (vla-get-objectid32 obj)
      (vlax-invoke-method (vla-get-utility doc) 'getobjectidstring obj :vlax-false)
    )
    (vla-get-objectid obj)
  )
)


HTH.

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Lee Mac

  • Seagull
  • Posts: 12905
  • London, England
Re: ** Error: no function definition: VLA-GET-OBJECTID32 **
« Reply #17 on: April 12, 2014, 08:37:46 AM »
Many thanks Ron  :-)

Rabbit

  • Guest
Re: ** Error: no function definition: VLA-GET-OBJECTID32 **
« Reply #18 on: April 24, 2014, 06:12:41 PM »
So will adding Ron's routine and using (_getobjectid docblocks a) instead of (vla-get-objectid32 a) in my routine below work?

Code: [Select]
(defun _getobjectid (doc obj)
    (if (and (_is64bit) (= (type vla-get-objectid32) 'subr))
      (vla-get-objectid32 obj)
      (vla-get-objectid obj)
    )
  )

Code: [Select]
(setq My_block (cdr (assoc 2 (entget FreshInsertedBlock))))
      (setq docblocks (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))))
      (setq a (vla-item docblocks My_block))
      (setq BlockObjectID (vla-get-objectid32 a))

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: ** Error: no function definition: VLA-GET-OBJECTID32 **
« Reply #19 on: April 24, 2014, 06:44:59 PM »
Been a long week so I may be overlooking something, but this is the way my brain's working today:

Code: [Select]
(defun _GetObjectID ( object )
    (if vla-get-objectid32
        (defun _GetObjectID ( object ) (vla-get-objectid32 object))
        (defun _GetObjectID ( object ) (vla-get-objectid object))
    )
    (_GetObjectID object)
)

tl;dr: Test once, and only as much as is req'd.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: ** Error: no function definition: VLA-GET-OBJECTID32 **
« Reply #20 on: April 24, 2014, 07:21:30 PM »
If one prefers the obfuscated:

Code: [Select]
(defun _GetObjectID ( object )
    (eval
        (cons 'defun
            (cons '_GetObjectID
                (list '(object)
                    (list
                        (if vla-get-objectid32 'vla-get-objectid32 'vla-get-objectid)
                        'object
                    )
                )
            )       
        )
    )
    (_GetObjectID object)   
)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: ** Error: no function definition: VLA-GET-OBJECTID32 **
« Reply #21 on: April 24, 2014, 07:36:56 PM »
If one prefers the obfuscated:

< .. >

I'm sure there is one.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: ** Error: no function definition: VLA-GET-OBJECTID32 **
« Reply #22 on: April 24, 2014, 07:45:07 PM »
lolz
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Rabbit

  • Guest
Re: ** Error: no function definition: VLA-GET-OBJECTID32 **
« Reply #23 on: April 25, 2014, 09:05:47 AM »
The "obfuscated" version worked great in 2012.  Since I don't have 2015, and I'm helping someone who does, I'll get back with you on if it works there.  Many thanks.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: ** Error: no function definition: VLA-GET-OBJECTID32 **
« Reply #24 on: April 25, 2014, 09:14:02 AM »
You're welcome and thanks for letting me know -- I wrote it under 2010 -- conceptually it should work for 2015 -- but it's merely a guess.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: ** Error: no function definition: VLA-GET-OBJECTID32 **
« Reply #25 on: April 25, 2014, 09:16:17 AM »
An aside -- is Rabbit the same person that used to post in the Take 5 forum with David Doane and crew a million years ago?
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: ** Error: no function definition: VLA-GET-OBJECTID32 **
« Reply #26 on: April 25, 2014, 09:49:08 AM »
Another variant for fun (penned under 2011, appears to work fine):

Code: [Select]
(defun _GetObjectID ( object )
    (eval
        (list 'defun '_GetObjectID '(object)
            (list
                (if vla-get-objectid32 'vla-get-objectid32 'vla-get-objectid)
                'object
            )
        )
    )
    (_GetObjectID object)   
)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

owenwengerd

  • Bull Frog
  • Posts: 451
Re: ** Error: no function definition: VLA-GET-OBJECTID32 **
« Reply #27 on: April 25, 2014, 10:21:56 AM »
An aside -- is Rabbit the same person that used to post in the Take 5 forum with David Doane and crew a million years ago?

Yes, and both are still posting. You should stop by and say "hello".

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: ** Error: no function definition: VLA-GET-OBJECTID32 **
« Reply #28 on: April 25, 2014, 10:27:24 AM »
Wow. Didn't know it was still active. Can you pm me the link Owen? Thanks so much for letting me know. tl;dr: I feelz old now.
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: 7526
Re: ** Error: no function definition: VLA-GET-OBJECTID32 **
« Reply #29 on: April 25, 2014, 11:19:28 AM »
FWIW .. Michael's version breaks Lee's code in AutoCAD 2015 x64. Don't have an x86 computer to test on.


(setq o (vlax-ename->vla-object (car (entsel))))
#<VLA-OBJECT IAcadLWPolyline 000000f2812dbb28>


MP_GETOBJECTID
1055


RJP_GETOBJECTID
"140694991308416"


Apparently vla-setblocktablerecordid will accept an integer or string.




Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC