Hi,
I’m trying to set up a system to assign domains on curves and store information in the .3dm-file. The idea is to use contextual input and Grasshopper Player to choose curves, get a domain and store the information as Document User Text for readability and access, with GUID as key and domain(s) as concatenated string values.
Current setup consists of:
-SetCrvParam, which (1) accepts a curve and two points, (2) calculates closest point on curve and (3) stores information through Rhinoscript in Python. If any domains for that curve was already set, add these to the stored string.
-DeleteCrvParam, which (1) accepts a curve and (2) sets corresponding values in Document User Text to ““.
-ReadCrvParam, which (1) checks curves in given layer and (2) outputs any associated domains.
Except this doesn’t really work as expected (by me, obviously). What I observe:
-The first function manages recieve new domains, but even if I manually clear the Document User Text table, the function “rs.GetDocumentUserText(crv)” still manages to find every domain previously added (or atleast that how I interpret the behaviour). These remnant domains seems to presist even after Save/Exit/Restart, which is rather spooky.
-The second function is fed a single curve GUID but still clears the Document User Text table, even if multiple curves where previously stored. Remnant domains seems to still be able to come back even aftr the function wipes the table.
-The third function seems to be okey but since the first two are not working, this doesn’t help much.
I’ve attached a .3dm-file for good measure but I doubt it’s connected to the model file, particularly since domains just keeps on getting added even with a new .3dm-file. Any ideas what might be off with the code?
SetCrvParam.gh (11.3 KB)
ReadCrvParam.gh (10.2 KB)
ClearCrvParam.gh (3.1 KB)
Testfile.3dm (47.4 KB)
