WHM Posted May 4, 2022 Posted May 4, 2022 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 ) Quote
mhupp Posted May 4, 2022 Posted May 4, 2022 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? Quote
WHM Posted May 4, 2022 Author Posted May 4, 2022 @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? Quote
ronjonp Posted May 4, 2022 Posted May 4, 2022 8 minutes ago, WHM said: Should I maybe consider attaching the primaryid with xdata to each object? That's how I manage my xdata. Quote
WHM Posted May 4, 2022 Author Posted May 4, 2022 I'll definitely give it a go and see how it performs, thank you Quote
WHM Posted May 5, 2022 Author Posted May 5, 2022 @ronjonp Thank you very much, that worked like a charm! In fact it makes things alot easier for me! 1 Quote
WHM Posted May 5, 2022 Author Posted May 5, 2022 @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! 1 Quote
Recommended Posts
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.