Jump to content

Edit symbol by handle


Recommended Posts

I have a PIO that does something similar to duplicate array, but parametric.

I also have a command that starts from a selected 2D or 3D object and turns it into a Serial Duplicate PIO

The duplicated object source has to be a symbol because I can’t use the profile group in a point plugin.

I’m trying to make a doubleclick on the object edit the symbol content. I tried the EditObjectSpecial, but that doesn’t seem to work...

Link to comment

Not surprising I guess (editobjectspecial). I use profile groups in WinDoor to store symbols. Here's a code snippet:

 

    { put symbol instance into profile group }
    
    Symbol(SymName, 0, 0, 0);
    hSym := LNewObj;
    h1 := GetCustomObjectProfileGroup(ghParm);
    IF h1 = Nil THEN Flag := SetCustomObjectProfileGroup(ghParm, hSym)
    ELSE BEGIN
        h2 := FInGroup(h1);
        IF (h2 <> Nil) & (GetTypeN(h2) = 15) THEN BEGIN
            DelObject(h2);
            SetPref(9871, True);
            Flag := SetParent(hSym, GetCustomObjectProfileGroup(ghParm));
            SetPref(9871, False);
        END;
    END;

 


 

  • Like 1
Link to comment

I had a hard time doing this for a PIO I was writing last summer.  EditObjectSpecial seems like the logical procedure, but I could never get it to work.  Joshua Benghiat shared a little snippet that worked like a dream: SetObjectVariableInt(<handle>,9743,0).  It's one of those things that doesn't appear in the function reference, so without special knowledge, it seems impossible.

  • Like 1
Link to comment

EditObjectSpecial only works for PIO's, and I believe mode 4 will give you the profile group.

 

Which ties into Julian's suggestion - any PIO can have a profile and path group as a sort of auxiliary storage. Path-based PIO's will use these automatically, but point-based PIO's can have them as well. In fact, if your PIO ultimately converts the symbols to a group, placing a copy of the symbol in the profile group will protect it from getting purged.

 

And assuming that you've jumped in to event based PIO's, 

    kObjOnSpecialEditID        = 7;
is the event for the double click, and 

    kObjXPropSpecialEdit        = 3;
    kCustomSpecialEdit        = 1;
are the extended properties you need to set in the init event

  • Like 1
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...