Julian Carr Posted March 24, 2021 Share Posted March 24, 2021 Can someone remind me how to set a record format to Read-Only or one that is set that way to NOT Read-Only? Thanks! Quote Link to comment
Pat Stanford Posted March 24, 2021 Share Posted March 24, 2021 I will do a better search of my archive later, but a quick search did not find anything. And my brain can't remember ever being able to make a read only record format. Quote Link to comment
Pat Stanford Posted March 24, 2021 Share Posted March 24, 2021 Hi Julian, I can't find anything in my archives about being able to set a Record Format to Read-Only. What is the situation you are dealing with and what would you like to be able to do? Quote Link to comment
Hippocode Posted March 24, 2021 Share Posted March 24, 2021 The typical way is to hide it from the resource browser. Just like object format records are not visible. If that isn't sufficient you might try working with catching the kNotifyRecordChange event but I doubt you can catch the exact change, you could compare this from a default sitting in your resource library. Quote Link to comment
Julian Carr Posted March 24, 2021 Author Share Posted March 24, 2021 What I want to do is to write to the read-only Plant Record that is attached to Plant objects. Exactly what I want to do is to clear most of the record fields in the Plant Data tab when editing the plant style. Currently you have to do it manually one line at a time so it is quite time consuming. It needs a Clear All button because many users will duplicate an existing plant style to create a new plant, and don't necessarily want this data duplicated. Here is the script I am working with, but I need a way to temporarily write to the plant record. It may not be possible. Procedure CPD; Procedure DoIt(h1 : HANDLE); VAR i1 : INTEGER; BEGIN FOR i1 := 1 TO NumFields(GetRecord(h1, 1)) DO CASE i1 OF 3,4,6,14..39: SetRField(h1, 'Plant Record', GetFldName(h1, i1), ''); END; ResetObject(h1); END; BEGIN ForEachObject(DoIt, (Sel=True) & (PON='Plant')); END; Run(CPD); Quote Link to comment
Hippocode Posted March 24, 2021 Share Posted March 24, 2021 It seems that the editing dialog / OIP controls the data and since the record is read only you won't have access. I couldn't find anything in the SDK related to this special hidden record type (besides some kludge calls) . I find it interesting myself as I'd like to have readonly records as well; @Vlado Is this feature exposed to VS / SDK? Quote Link to comment
Vectorworks, Inc Employee klinzey Posted March 24, 2021 Vectorworks, Inc Employee Share Posted March 24, 2021 It doesn't look like there VS or SDK access to allow the record to writable. Quote Link to comment
Vectorworks, Inc Employee Vlado Posted March 24, 2021 Vectorworks, Inc Employee Share Posted March 24, 2021 22 minutes ago, Hippocode said: I couldn't find anything in the SDK related to this special hidden record type (besides some kludge calls) . I find it interesting myself as I'd like to have readonly records as well; Lock the handle and it will show up as read only. SDK: gSDK->LockObject, there doesn't seem to be a Script function to lock objects Quote Link to comment
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.