Peter Vandewalle Posted February 8, 2021 Share Posted February 8, 2021 Hi folks, I'm looking into a way to edit a symbol known by its handle. I have a plugin that duplicates a symbol. Now I'd like to edit that symbol by doubleclicking the PIO in the drawing... Quote Link to comment
Pat Stanford Posted February 8, 2021 Share Posted February 8, 2021 I don't think the functionality you want exists, but please give us a better description of what you are trying to do and perhaps we can make some recommendations. Quote Link to comment
Peter Vandewalle Posted February 8, 2021 Author Share Posted February 8, 2021 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... Quote Link to comment
Julian Carr Posted February 8, 2021 Share Posted February 8, 2021 Try using: EditObjectSpecial(SymHandle, 4); Using 4 as the second argument will just jump you straight into the symbol based on whether the view is Top/plan or not - no dialogue. Curious. Why can't you use the profile group? Quote Link to comment
Peter Vandewalle Posted February 8, 2021 Author Share Posted February 8, 2021 Hi Julian, I tried the editobjectspecial(h, 4) and got an error. Apparently it doesn’t work from within a PIO. And about the profilegroup, it doesn’t seem to be possible to get the content from that group in a point PIO. Quote Link to comment
Julian Carr Posted February 8, 2021 Share Posted February 8, 2021 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; 1 Quote Link to comment
Jesse Cogswell Posted February 9, 2021 Share Posted February 9, 2021 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. 1 Quote Link to comment
JBenghiat Posted February 9, 2021 Share Posted February 9, 2021 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 1 Quote Link to comment
Peter Vandewalle Posted February 9, 2021 Author Share Posted February 9, 2021 Thanks all, you rock! SetObjectVariableInt(hSymbol, 9743, 0) did it. We found an old post by @klinzey about this. @klinzey: Do you know where can we find this value? Quote Link to comment
Matisse Posted December 23, 2023 Share Posted December 23, 2023 Found this post this am. It is probably obvious for most people, but it took me a while to figure out to change the "0" to "4" to edit 3D. SetObjectVariableInt(hSymbol, 9743, 4); m 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.