Jump to content

Implement a drawing into an PIO


Recommended Posts

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 🙂

 

image.thumb.png.69907f29bbcce084eec80897fb09087f.png

 

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?

 

Link to comment

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)

Link to comment

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 by MullinRJ
Link to comment

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..."

image.png.dddb5aa5c76f76213b18526627489d7f.png

 

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...

Link to comment

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.

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...