Jump to content

Difference between vsoGetPluginStyleSym and GetPluginStyleSymbol


Recommended Posts

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)

 

Link to comment

Hello @Gregi,

   Though I haven't used either command it appears the first, vs.vsoGetPluginStyleSym(), is used to reference itself and return the Symbol Definition linked to its STYLE definition. Its description says: "Allow an object to use its own implementation in creating and maintaining a plugin style." It must be used inside the PIO code, as indicated by the first three letters in the command name "vso".

 

   The second command, vs.GetPluginStyleSymbol(), appears to be used outside a PIO, as in a script that queries PIO objects, and it will return TRUE if the object is STYLED, and FALSE if it isn't. If it returns TRUE, it will also return a handle to the symbol that's used to define its STYLE.

 

   The best way to see what they do is to try them in simple scripts. Place a STYLED PIO in a drawing and write a short script with:

Boo, SymHnd = vs.GetPluginStyleSymbol(FSActLayer) to see what it returns. Message out the boolean result, and the object type and symbol name of the returned handle.

 

   The vso command will require more setup to test its functionality, but if you are developing a STYLED PIO, place vs.GetPluginStyleSym() in your PIO script and set an AlrtDialog() with the object type and symbol name of the returned handle to see what comes out. You may have to move the command around so that it executes in the proper event and at the proper time.

 

   If this is not clear, wait for better answers. I'm sure they are out there.

 

Raymond

Link to comment

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

Link to comment

Asking for two input parameters may be a mistake, but it may also work as defined if the second parameter is sometimes an input parameter. Some input parameters will accept NIL (or None) as valid input and report differently from passing in a non-NIL value. Again, I'm guessing here as I've never used the function. If it works as you've shown, then use it. Keep notes for future reference. You never know if, or when, things may change. 

 

Raymond

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