Gregi Posted April 17, 2023 Share Posted April 17, 2023 I'm struggling with integrate a drawing into my styled PIO. My PIO is using this drawing as the basis to create the object. So this drawing should be a "parameter", invisible in the end, but not deleted. If I could have a look how it works with the title block as an example, this would maybe be a lot of help 🙂 On my way to look for a solution i created a 2D-path-object, so the profile group is my "base". The PIO is working good, but there are (at least) two things not working: to edit the profilegroup i created a button. It works, but after i left the "edit group", i have to close and re-open the document to see any of my PIO #Konstanten Event kParametricRecalculate = 3 kOnObjPref = 4 kObjOnInitXProperties = 5 kObjOnDoubleClick = 7 kObjOnObjectUIButtonHit = 35 kObjOnWidgetPrep = 41 kObjOnEditPluginStyle = 60 kObjCreatePluginStyle = 61 kObjUpdatePluginStyleObject = 62 kObjFinalizeCreateStyle = 63 kObjFinalizeUpdateStyledObject = 64 kObjStyleWidgetChosen = 65 nachAbschlussStilbearbeiten = 81 # 70? # 82? # 85? ButtonIDObjektBearbeiten = 1234 (theEvent, theButton) = vs.vsoGetEventInfo() (ok, gPio_N, gPio_H, gPioRec_H, gWall_H) = vs.GetCustomObjectInfo() if theEvent == kObjOnInitXProperties: #5 ok = vs.vsoAppendWidget(kWidgetButton, ButtonIDObjektBearbeiten, 'Objekt bearbeiten...', 0) #Button hinzufügen vs.SetObjPropCharVS(kObjXPropEditGroup, vs.Chr(kObjXPropEditGroupProfile)) #mit Knopf wird direkt Profilgruppe bearbeitet if theEvent == kObjOnObjectUIButtonHit: #35 if theButton == ButtonIDObjektBearbeiten: vs.EditObjectSpecial(gPio_H, 4) the button only works to edit my profile-group "by instance". I could not find a way to edit the group within the style OIP. Even if i would find a way to edit the instance-group an then move the drawing into the style (by script), there would be no way to do so by right-click the red-symbol in the resource manager what am i missing? is there any documentation? or a way to get the source-code of any "scripts by vectorworks" which are not in sdk? Quote Link to comment
Pat Stanford Posted April 18, 2023 Share Posted April 18, 2023 If your object is not an extrude along Path you can use the Profile Group to store objects that you want to have "contained" in the PIO but not drawn by the PIO. You can access them by handles to get the object information you need to draw your PIO. Quote Link to comment
Gregi Posted April 18, 2023 Author Share Posted April 18, 2023 Yes, this is exactly what I'm doing. But i struggle in editing my Profile Group. 3 hours ago, Pat Stanford said: You can access them by handles Which handle, or which function, would you recommend to edit my object? (instead of EditObjectSpecial) Quote Link to comment
MullinRJ Posted April 18, 2023 Share Posted April 18, 2023 (edited) Have you tried: def vs.GetCustomObjectProfileGroup( objectHand ) return HANDLE where objectHand can be a handle to a PIO object in the drawing when your script executes outside of PIOs, and objectHand can be gPio_H (from your example above) when your script is the PIO script? Raymond Edited April 18, 2023 by MullinRJ Quote Link to comment
Pat Stanford Posted April 18, 2023 Share Posted April 18, 2023 Ad then use FInGroup to get a handle to the objects in the group and then walk the tree (NextObj) to find what you need. Quote Link to comment
Gregi Posted April 18, 2023 Author Share Posted April 18, 2023 Thanks for your inputs I guess my explanation was not exact 😉 I would like to make it possible to edit the drawing by users. So like "edit Symbol" or "edit group", where VW shows the drawing with the yellow frame, where you have to exit the drawing by clicking "exit..." I'm able to do so as long as i hit the button on the instance (not within the "edit style" window) - but after exit i have to re-open the document to see any of my PIO... Quote Link to comment
Pat Stanford Posted April 18, 2023 Share Posted April 18, 2023 Running out the door and no time to test, but you probably need a ResetObject(HandleToYourPIO) or something similar as part of your code. Is this a standard PIO or Event Enabled? If Event Enabled you need to put the Reset in the correct event. Quote Link to comment
Gregi Posted April 23, 2023 Author Share Posted April 23, 2023 I did many tests with ResetObject and similar without succes. Now i got a workaround with exporting to symbol, so you can edit the symbol, and then there's another button to re-import the symbol which replaces the GetCustomObjectProfileGroup. It is not as Nice as i would like to have it, but right now it works. 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.