Jump to content

Setting Record Format to Read Only - Or Not


Recommended Posts

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.

Link to comment

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);

Link to comment

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?

Link to comment
  • Vectorworks, Inc Employee
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

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...