Author Topic: XRecord restrictions  (Read 6104 times)

0 Members and 1 Guest are viewing this topic.

T.Willey

  • Needs a day job
  • Posts: 5251
XRecord restrictions
« on: July 11, 2006, 07:19:38 PM »
I'm trying to help someone on the Adesk Ng.  What it looks like he is wanting to do, is add entity code data to a dictionary object as xrecords.  I posted one routine that I use to do this, but he said that it error'ed, and when I tested it with entity code, it did.  Enough back ground I hope.

My question is, Can you input a list into an Xrecord?  My first thought is no, but would like input from people with more experience than I have in this area.  If needs be, I can post the code that I shared.

Thanks in advance for any/all help.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: XRecord restrictions
« Reply #1 on: July 11, 2006, 07:44:48 PM »
Here is a quick code that I can up with to see if that was the problem, and right now it seems to work, but I haven't the time to test if correctly.  I will get back at this tomorrow, but here is the code if anyone wants to see it.  It can be written better, but I just wanted to get something working.
Code: [Select]
(defun MakeVariant (Lst)

(vlax-make-variant
 (vlax-safearray-fill
  (vlax-make-safearray
   vlax-vbVariant
   (cons 0 (1- (length Datalist)))
  )
  (mapcar
   '(lambda (x)
    (if (equal (type x) 'LIST)
     (vlax-make-variant
      (vlax-safearray-fill
       (vlax-make-safearray
        vlax-vbVariant
        (cons 0 (1- (length x)))
       )
       x
      )
     )
     x
    )
   )
   Lst
  )
 )
)
)

I know it should be recursive, but when I tried it first it didn't work, I think I can do it now, but don't have the time. :-)
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

LE

  • Guest
Re: XRecord restrictions
« Reply #2 on: July 11, 2006, 07:46:47 PM »
nevermind...... (where is the remove button.... )
« Last Edit: July 11, 2006, 07:51:02 PM by LE »

Jeff_M

  • King Gator
  • Posts: 4094
  • C3D user & customizer
Re: XRecord restrictions
« Reply #3 on: July 11, 2006, 08:01:53 PM »
Luis, they are trying to use ActiveX and, as Tim discovered, you must convert all lists to variants.

Tim, I don't think you would need to make it recursive for this application since an Entity list will never be nested beyond the point/vector types.

Oops, Luis withdrew his response......but I'll leave this for Tim anyway.

Jeff_M

  • King Gator
  • Posts: 4094
  • C3D user & customizer
Re: XRecord restrictions
« Reply #4 on: July 11, 2006, 08:03:17 PM »
(where is the remove button.... )
Good question, LE! We used to have a delete, didn't we?

LE

  • Guest
Re: XRecord restrictions
« Reply #5 on: July 11, 2006, 10:02:14 PM »
(where is the remove button.... )
Good question, LE! We used to have a delete, didn't we?

Yes....  :-(

It may be part of the update for the site.... BTW, I had previously the option to "Remove the topic" available on this one (that I did not started), very strange.

LE

  • Guest
Re: XRecord restrictions
« Reply #6 on: July 11, 2006, 10:04:37 PM »
Luis, they are trying to use ActiveX and, as Tim discovered, you must convert all lists to variants.

Tim, I don't think you would need to make it recursive for this application since an Entity list will never be nested beyond the point/vector types.

Oops, Luis withdrew his response......but I'll leave this for Tim anyway.

Sorry;

I was out of the scope... that's why.....  :-(

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: XRecord restrictions
« Reply #7 on: July 11, 2006, 11:21:01 PM »
Tim, I don't think you would need to make it recursive for this application since an Entity list will never be nested beyond the point/vector types.

Wondering aloud <<but I took a sleeping pill about 1/2 hour ago, so I could be daffy in the head>> what about xdata?

Having said that, without the benefit of understanding the application I fnd the notion of  storing entity data in xrecords a bit superfluous. I can only guess that the application is performing some kind of roll-back activities.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Jeff_M

  • King Gator
  • Posts: 4094
  • C3D user & customizer
Re: XRecord restrictions
« Reply #8 on: July 12, 2006, 01:15:03 AM »
Well, I don't have Autocad here to check but I was under the impression Xrecord data types were only allowed up to ~369 . Xdata starts at 1000 so that would preclude them from being in the Xrecord. Or am I not recalling correctly?

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: XRecord restrictions
« Reply #9 on: July 12, 2006, 06:08:36 AM »
That makes sense Jeff, surely more than my last couple posts.

 :ugly:

Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

T.Willey

  • Needs a day job
  • Posts: 5251
Re: XRecord restrictions
« Reply #10 on: July 12, 2006, 11:17:07 AM »
I have no idea what the OP on the Adesk Ng wanted help for.  I was only trying to find an answer to the problem, since I didn't know the answer, and I wanted to.

I can only guess that the application is performing some kind of roll-back activities.
This is my guess also.

Well, I don't have Autocad here to check but I was under the impression Xrecord data types were only allowed up to ~369 . Xdata starts at 1000 so that would preclude them from being in the Xrecord. Or am I not recalling correctly?
I think you are right Jeff.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: XRecord restrictions
« Reply #11 on: July 12, 2006, 11:31:55 AM »
Sorry Tim, didn't mean to sound so negative. Terse Post + Under The Influence.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

T.Willey

  • Needs a day job
  • Posts: 5251
Re: XRecord restrictions
« Reply #12 on: July 12, 2006, 11:39:29 AM »
Sorry Tim, didn't mean to sound so negative. Terse Post + Under The Influence.
No problem at all Michael.  I didn't take it that way.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.