Jump to content

Permanent list storage AutoCAD


WHM

Recommended Posts

Good day all,

 

I'd like to store a pair list of +-10 000 different entries permanently in a drawing. The "Handle" is the entity handle and the "Primaryid" is a response from a API, what I'm trying to do is to store a list of entities with their corresponding primaryid and then used that data to update the API.

 

I've been able to store it as a xrecord (as below), but it takes long to create it and it takes long to process it back to a pair list.

 

What are my options? Am I missing anything with the xrecords? Any advice on how to store the data fast and permanent?

 

(list
	(list "Primarid" "Handle")
	(list "Primarid" "Handle")
	(list "Primarid" "Handle")
	(list "Primarid" "Handle")
;x10000
)

;;xrecord format
(
	(1. "Primarid:Handle")
	(1. "Primarid:Handle")
	(1. "Primarid:Handle")
	(1. "Primarid:Handle")
;x10000
)

 

Link to comment
Share on other sites

The handle is part of the dxf code in the drawing. I was able to pull 12789 handles from a selection set and put them in a list in 313 ms. i think they bottle neck might be either the api or how your matching them. would need more info. how id the primarid generated? how is it matched to the handle?

 

 

 

Link to comment
Share on other sites

@mhupp So the entity information of all the objects get converted into a GeoJson format and that information gets pushed to a webserver via a HTTP call. Once the object gets drawn on the server side (online map) the server responds with a unique primaryid.

 

I want to reference the primaryid to the entity handle name, that way I'll always reference the same object even if I start a new drawing session. I'm trying to prevent duplicate objects and things like that.

 

Should I maybe consider attaching the primaryid with xdata to each object?

Link to comment
Share on other sites

8 minutes ago, WHM said:

Should I maybe consider attaching the primaryid with xdata to each object?

That's how I manage my xdata.

Link to comment
Share on other sites

@ronjonp and @mhupp

 

So as a alternative I wrote a piece of code that fills the xrecord length to 2047 characters and then creates a new xrecord and does the same until all the data is added. It was a wildly stupid way of handling it!

 

In this use case xdata works so much better! 

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...