Jump to content

Jayme McColgan

Member
  • Posts

    214
  • Joined

  • Last visited

Reputation

21 Great

1 Follower

Personal Information

  • Location
    United States

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. yeah i had the datetime there for debugging... forgot to delete it before sending this example. i might look into the PythonExecute() stuff at a later date but this seems to be working for now. gonna test it with some users and see if any issues come up.
  2. ok here's my basic scripts that seem to be working for now. let me know if I'm missing anything... Python Menu Command Plugin import vs, datetime, tool_checker def start(): curdate = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") checked = tool_checker.get_serials() vs.Rpstr_SetValueBool("oTGMlvZs6m", checked) vs.Message(str(f"Plugin ran at {checked}")) #only here for debugging return None Here's the basic VS Code I wrote to check this. will integrate these lines into the VS Code at the start of the plugin. PROCEDURE VS_CheckAllowed; VAR allowed : BOOLEAN; BEGIN DoMenuTextByName('Test Menu Plugin', 0); allowed := Rpstr_GetValueBool('oTGMlvZs6m', FALSE); IF allowed THEN AlrtDialog('Allowed') ELSE AlrtDialog('Not Allowed'); END; RUN(VS_CheckAllowed);
  3. I guess it's finally time to learn the SDK. but in the mean time. tell me more about this... What's the string repository? EDIT: i found all the Rpstr commands. buildign a plugin now.
  4. @Dave Donley currently I'm using vs.ValidNumStr(vs.GetRField(PIO_handle, recname, "X Offset"))[1] to get the dimension from the field. Is there a function to then turn that into millimeters so i can do the image offset for the texture, since that only wants mm?
  5. Sadly, ResetObject() didn't seem to work for me, didnt seem like it did anything. I'm trying somewhat of a hacky process that will pull all the field info for the instance I have selected, insert a new instance with vs.CreateCustomObjectN(), and fill in the fields with the data from the old instance, then delete the old version. I'm sure that will spawn some other issues that will be later jaymes problem. lol
  6. Sadly, it's a good amount of Python code that can't really be plaintext, so I can't just open the file. Maybe I could encrypt the Python file and have VS decrypt it every time? The Python I need to check is for a license checker, which is totally easy for my Python-based plugins because I just include the "checkserial.py" in the plugin encryption process. Some of our legacy plugins are written in VS, which I don't have the time to rewrite them so I need to figure out a way for those VS-based plugins to check a license serial flow I built in Python. My original idea was to bake the Python script into its own "CheckSerial" menu plug-in and have the VS plugins to call that plugin and return a true or false if the user is licensed to run my plugins.
  7. So I need to have a VS-based plugin call a pretty extensive Python script and get the response from that script. What's the best way to do that? My first thought was making a Python based plugin and calling that tool from within the VS plugin, but I tried all the vs.CallTool() variants, but it seems you can only get a true/false that the call was successful? Is there a better way to do this?
  8. So I just made some changes to the PIO of one of my plugins that's breaking odd instances of that plugin in older drawings. Is there a way to run a command in an older drawing that would find all the instances of a plugin and recreate them with the new version of it? I hope that makes sense.
  9. @Dave Donley SUCCESS! The code below got me the pixel dims of the texture. Thank you, sir. ledtext2 = vs.GetObject(ledimage) shrec = vs.GetShaderRecord(ledtext2, 1) varhan = vs.GetObjectVariableHandle(shrec, 550) texwid = vs.GetObjectVariableLongInt(varhan, 534) texhei = vs.GetObjectVariableLongInt(varhan, 535) Can I also get some help with understanding what the units that offsetX:1, offsetY:2 for vs.SetTexMapRealN() use? It seems like it's millimeters, no matter what dim mode I have the document in. Is that true? I'd like to use a dimension field in the PIO to set this, but I'm not sure what units to convert it to. vs.SetTexMapRealN(last, 3, 0, 1, xoff) vs.SetTexMapRealN(last, 3, 0, 2, yoff)
  10. hey Pat! been a while. I'm going to explore this, but sometimes these textures are on a surface that is faceted or curved. just getting the distance between X1,Y1 and X2,Y2 would always work but its a good direction to look.
  11. @Dave Donley I tried this code with no luck. The first 3 all return handles, but when I try to get the paint node, it returns "None". Also, the wiki says that vs.GetTexBitPaintNode(textureBitmap) is obsolete. Am I using the right function? ledtext2 = vs.GetObject(ledimage) shrec = vs.GetShaderRecord(ledtext2, 1) texbit = vs.GetTextureBitmap(shrec) paintnode =vs.GetTexBitPaintNode(texbit) texwidth = vs.GetObjectVariableInt(paintnode, 530) vs.Message(f"{ledtext2} / {shrec} / {texbit} / {paintnode} / {texwidth}")
  12. I'm really struggling to get the aspect ratio of a RenderWorks texture image. any pointers would be appreciated ive tried these plus a few others with no real luck. vs.GetTexBFeatureStart(textureBitmap) vs.GetTexBFeatureEnd(textureBitmap) vs.GetTexBitFeatureSize(textureBitmap)
  13. I'm using vs.SetTexMapRealN(last, 3, 0, 3, imagescale) to set the scale of a texture on an extrude. I'd like to add a setting where it stretches the texture to fill the whole extrude, even if it distorts the image. right now it seems to only be able to scale within aspect. is there a way to do this?
  14. This is solved... the new unverified plugin window was disabling this, and I didn't notice.
  15. even more confusion... I was reading through https://github.com/Vectorworks/developer-scripting/blob/main/Function Reference/Functions/EncryptPlugin.md It says this, but that isn't an option I can see anywhere. Note: You need to install the Script Batch Process feature from the Vectorworks Developer section of Help → Install Partner Products... menu command. Or you can find the plugin within the SDK distribution.
×
×
  • Create New...