Message 1 of 8
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a requirement to add parameters and bind them to most if not all elements in a model (and one parameter to be bound to a type instead; your blog was most helpful with that), but I'm running into a few issues.
Currently my code creates a shared parameter file if not found, creates a group, and then adds the parameters to it. The problem comes as follows:
- Sometimes the parameters are "duplicated" because I can't seem to specify a GUID for the parameter; I can only search for it by name - and the shared parameter file was not sent to me for testing, only the Revit File.
Revit GUIDs seem to be type 4, which is frustrating because those are fully random and that means I can't predict them at all, which means I can't really test for a specific GUID. - If the file is already created (because I was using another Revit document) the parameters "exist" in the document but aren't bound to anything, which frustrates the dupe checks because the parameter exists by name; however an insert/reinsert rebinding will work.
- I can determine via code right now if I have to write the file from scratch, but I haven't yet run into the situation where the customer has a parameter file and I just need to add to it (which I'm sure happens all the time).
- If the file does exist, I would rather be able to set a specific GUID instead of clobbering the user's file with our own (that seems the only way to set a particular GUID is to write a shared parameter file with the GUID and then tell Revit to use that file).
- The goal here is that the user can click one button and our parameters are set up to facilitate two-way data binding between our system and the Revit Model.
Am I missing something in the API that allows me to specify a GUID? What are the best practices around this? Does the Revit API have some way to modify the shared parameter file or only the binding functions?
I found this related issue,
However it's not answered nor is it exactly my problem.
Solved! Go to Solution.