Setting View Reference values
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a large project where I am breaking this down into 1:100 views on A1 sheets. Due to this I have nearly 4000 'For Continuation Refer To...' type View References to place and set to the correct continuation sheet. I have developed a script in Dynamo that is finding the correct Id and View Name of the continuation and have tried to drive these into the View Reference family by both the ValueString and ElementId (see snippet below - note both lists for view Id and Name are mapping correctly to the ViewRef). In both cases I get an error warning saying "Parameter is read-only". Do I need to open a transaction to push this value in or is this still not able to be achieved via the API? Maybe my method needs some rethinking? I recall asking a similar question some time ago and Mr Tammik suggested this was not possible at the time.
ctr = 0
for VR in ViewRefsIN:
VRTargetId = VRTargetFoundId[ctr]
VRTargetStr = VRTargetFound[ctr]
for VRP in VR.Parameters:
if VRP.Definition.Name == "Target view":
VRP.Set(VRTargetStr).AsValueString
#VRP.Set(VRTargetId).AsElementId
ctr += 1
Thanks in advance for any ideas or help here.