Jump to content

Gregi

Member
  • Posts

    65
  • Joined

  • Last visited

Posts posted by Gregi

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

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

  3. Hi @MullinRJ

     

    Thank you for your reply.

    For sure, i did a lot of trying of those two functions 🙂

     

    I put both of them in my script and comment / uncomment. But the vs.vsoGetPluginStyleSym() is always crashing VW.

     

    I was wondering, why vs.GetPluginStyleSymbol needs two inputs (in the function reference it says: vs.GetPluginStyleSymbol(hObject, hSymDef)) but it works in this way:

    bisStyled, StyleSym = vs.GetPluginStyleSymbol(gPio_H, None) #Prüfen, ob PluginObjekt Stilgesteuert ist

     

    It is hard to get any information about some functions, especially in combination with event-based PIOs. Probably the "vso"-Function is only meant to work in a special event-case?

     

    Gregi

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

     

  5. Hello

     

    I'm working on a PIO with Styles.

    The PIO is a path object, so there's a profile and a path-group.

    If i would like to get the profile group "by style", i need a way to change the profile in the symdef - but how?

     

    I think it has to be done with one of those functions, but what's the difference between those two?

     

    def vs.vsoGetPluginStyleSym():
        return hSymDef
    
    def vs.GetPluginStyleSymbol(hObject, hSymDef):
        return (BOOLEAN, hSymDef)

     

  6. On 7/9/2022 at 11:02 AM, _c_ said:

    BTW, I wouldn't set view at each regen of a PIO, a PIO has its own environment.

    You can coerce the Pio to regen on Top plan only in the Plug-in Properties, set "Projection" to "requires 2D"

    If you need to create 3D geometry from within, you might want to use vs.SetPlanarRefIDToGround on the 2D source shape, convert to NURBS or whatever, then turn it around in 3D as needed.

    I had some trouble in trying this, but id didnt work. maybe come back to this point later in my project.

    But as long as it works this way, im happy with it 😉

  7. Hello everybody

     

    So, almost a year has gone...

     

    so I got the "Style" thing a little bit of working, but not in the way i would like to.

    1. To have my Button in OIP AND in plugin-style-dialog is ok, i managed to do so
    2. How do I manage to have a pick-box to this button (better: the drawing behind it) in the settings? (screenshot)
    3. which way would you recommend to have a drawing object inside my PIO? I started with an 2d Path Object, to have the profile-Group for this. The Button just handles to "Edit Profile-Group"
    4. If i set the parameters "by style" the fields in OIP are grey (like expected), but on doubleclick i get the handles and if i edit the form, i can change those parameters by instance. to bring them back to "style" i have to open "edit style" an close. do i have to include an override in my code, like "if this param is set by style, copy param from style-sym-def"...?
    5. is there any "good" list of event constants anywhere (Appendix or similar)? it is a lot of work to search "all" the stuff about event handling, but it sounds really interesting to work with those things

     

    image.png.1775d13266e21b9549f89660b2228be0.png

  8. hello everybody

     

    this is really helpful. I'm trying to create my own styled PIO. It works kind of good, but there's one thing i still don't get:
    I would like to "implement" an Object in the style, like the profile of my 2D-Profile-Object.

    image.png.2b5f9f436627391f66429c549e1528a1.png

     

    Is there a Way to "easy" Add a Buton on the "kEditPluginStyleDefault" thing?

    I tried "AddToPluginStyle" and/or "AddToPIOStyleEdit" with no succes - but i don't know in which part of Event-Trigger i would have to pack anything

     

    i couldn't get any information about how drawn objects can be a part of a style, maybe @_c_ does have any idea because of the great things from vectorlab? 🙂

    image.png.db3169996a12d786e0377c273f675524.png

     

  9. I guess you could create any master-object which is connectet to a database an name it. in your marionette you get this object by name an gets its database entrys.

     

    If your master-object is a symbol with symbol-text you have a "Master-Table" or something like that.

    image.png.7339a22b5e75651ff37c7ad671440858.png

  10. I'm really thankfull to this post!

     

    I'm doing a lot of try and error, but it works pretty fine! 🙂

     

    On 3/29/2021 at 6:56 AM, _c_ said:

    Warning: you will need to close and re-open your document to see widget groups display properly EVERY time you change something in the parameter index list (add, delete parameters)

    I guess, a simple open and close the Editing-Window in the PlugIn Manager is working as well..

    • Like 2
  11. Is there a way to replace the code inside a Marionette node?

     

    I have a lot of self-made nodes and they are used in several Marionette-Objects. Now, I made some changes ("updates") and would like the put them to all those nodes. Any other way instead of open the Objects and replace the code manually would be great...

     

    Great thank to any idea 🙂

  12.  

    On 3/3/2021 at 9:40 PM, willofmaine said:

    Why would Marionette work fine in VW 2018 back in the year 2018, but not here in 2021?!?!...

     

    i do have the same problem.
    I have a lot of Marionette-Objects, saved as red symbols. Since I installed VW2021 i have a huge load of issues and VW crashes.

    If i want to reconstruct this, VW2020 crashes to. demotivating

     

    any idea? some changes in python?

  13. Hi everybody

     

    I have some Marionette-PIOs saved as "red" Symbols.

    I would like to import them to another more complex Marionette PIO and change some Parameters.

    Is there a way to get the Parameters like the custom objects?

    How do i get the Handles to my parameters?

    • Like 1
  14. Hi everybody

     

    I would like to create a Symbol definition as a copy of the Objects in a PIO.

    I made a node which is working if testing as a network or a wrapper. But as soon as i put it in my PIO, the PIO will go away, but i have the symbol.

    Any ideas?

    image.thumb.png.ac1e7e92e83997b9bd4ae5b66361205e.png

     

    and the code of my "Create Symbol"-Node:

    #gim 2020-12-24
    #Revised 12/21/15 MFarrell
    #Modified by MFarrell May 2017
    @Marionette.NodeDefinition
    class Params(metaclass = Marionette.OrderedClass):
    #APPEARANCE
    	#Name
    	this = Marionette.Node( "Create Symbol" )
    	this.SetDescription( "Fügt ein Symbol im gewünschten Ordner ein" )
    
    	#Input Ports
    	sym = Marionette.PortIn( '', 'sName' )
    	ordner = Marionette.PortIn( '', 'sOrdner')
    	sym.SetDescription( "Name of symbol." )
    	obj = Marionette.PortIn(vs.Handle(0), 'hObjs')
    #	p = Marionette.PortIn( (0,0), 'p' )
    #	p.SetDescription( "Coordinates of symbol insertion point." )
    #	angle = Marionette.PortIn( 0, 'nAngle' )
    #	angle.SetDescription( "Rotation angle of symbol, in degrees." )
    
    	#OIP Controls
    
    	#Output Ports
    	h = Marionette.PortOut()
    #	h.SetDescription('Handle to Symbol object')
    
    #BEHAVIOR
    #	this.SetLinksObjects()
    	this.SetListAbsorb()
    	
    def RunNode(self):
    	#inputs
    	sym = self.Params.sym.value[0]
    	ordner = self.Params.ordner.value[0]
    	obj = self.Params.obj.value
    	if type(obj) != list:
    		obj = [obj]
    
    	#script
    	vs.SetOriginAbsolute(0, 0)
    		
    	vs.BeginSym(sym)
    	for x in obj:
    		objn = vs.CreateDuplicateObject(x, None)
    		vs.Marionette_Dispose(x)
    	vs.EndSym()
    	symbol = vs.LNewObj()
    
    	#wenn noch nicht vorhanden, Ordner erstellen
    	if ordner != '':
    		if vs.GetObject(ordner) == None:
    			vs.NameObject(ordner)
    			vs.BeginFolder()
    			vs.EndFolder()	
    		place = vs.GetObject(ordner)
    		vs.InsertSymbolInFolder(place, symbol)
    	
    	
    	#outputs
    	self.Params.h.value = h

     

  15. I got kind of success:

    With this Tool:

    vs.DoMenuTextByName('Solid Operations', 4)

    its doing what i want to do. Even since the index "4" isnt listet in the appendix. Im not sure if its not in the internal version?

     

    But it opens a window and asks for user input.

    Is there a way to skip this input? I could control all the needs in marionette before (its only about direction of NURBS and fore- or background ob objects to select which one will cut the other...

    image.thumb.png.bf3053462a67caf0d9db528439c0f05f.png

×
×
  • Create New...