Jump to content

PatW

Member
  • Posts

    85
  • Joined

Everything posted by PatW

  1. That could be done by the remote debugger but according to this topic it is not working reliable. https://developer.vectorworks.net/index.php/Python_Debugging When the script fails you should see the error message poping up in VW that tells you in which function and which line the problem occured. Make sure the VW option run scripts in debug mode is enabled.
  2. You could try it with one of these: https://developer.vectorworks.net/index.php/VS:ReDraw https://developer.vectorworks.net/index.php/VS:RedrawSelection https://developer.vectorworks.net/index.php/VS:ReDrawAll
  3. Connections are not stored in the Record, they are stored in a Userdata node which can not be accesed by Python/Marionette as I know. https://developer.vectorworks.net/index.php/SDK:User_Data
  4. This file settings are very likely stored hidden in the file data. If it would be stored in a seperate file the prefs would be lost when sharing the vwx with someone.
  5. Yes the VWR is a ZIP file. You could create a batch file that creates the zip with "7Zip" in the Post build event. This was quickly put together and is untested: cd C:\Program Files\7-Zip 7z a "C:\Users\pwink\Desktop\res.zip" "C:\Users\pwink\Documents\DEV\CableTools\CableTools.vwr\DialogLayout" "C:\Users\pwink\Documents\DEV\CableTools\CableTools.vwr\Images" "C:\Users\pwink\Documents\DEV\CableTools\CableTools.vwr\Strings"
  6. Try this function: https://developer.vectorworks.net/index.php/VS:GetPenFore
  7. In the SDK you would use the class IExtensionWebPalette to define your webpalette and IWebJavaScriptProvider to register the JavaScript functions which can hand data back to the C++ part. class YourCustom_JSProvider: public VCOMImmediateImpl<IWebJavaScriptProvider> { public: CableToolWebPaletteJSProvider(); virtual ~CableToolWebPaletteJSProvider(); virtual void OnInit(IInitContext* context); virtual void VCOM_CALLTYPE OnFunction(const TXString& name, const std::vector<VWVariant>& args, VectorWorks::UI::IJSFunctionCallbackContext* context); private: IWebPaletteFrame* fWebFrame; }; // -------------------------------------------------------------------------------------------------------- class YourCustom_JSProviderCableToolWebPalette : public VCOMImmediateImpl<IExtensionWebPalette> { DEFINE_VWPaletteExtension; DEFINE_VWProtection; public: CableToolWebPalette(CallBackPtr); virtual ~CableToolWebPalette(); virtual IEventSink* VCOM_CALLTYPE QueryEventSink(const TSinkIID& iid); virtual TXString VCOM_CALLTYPE GetTitle(); virtual bool VCOM_CALLTYPE GetInitialSize(ViewCoord& outCX, ViewCoord& outCY); virtual TXString VCOM_CALLTYPE GetInitialURL(); private: CableToolWebPaletteJSProvider fJSProvider; }; Register the function: void YourCustom_JSProvider::OnInit(IInitContext* context) context->AddFunction( "VW_UpdateData" ); When it is triggered in the webpalette this callback is executed: void YourCustom_JSProvider::OnFunction(const TXString& name, const std::vector<VWVariant>& args, VectorWorks::UI::IJSFunctionCallbackContext* context) Unfortunately there is no doc about this on the vw wiki.
  8. Here is a solution that works with a list that has na even amount of members. For uneven lists you could addd another placeholder value and remove it from the final list again. zipList_v2020.vwx
  9. There is a auto compensation if you exceed the maximum chainlength of the hoist. A possible workaround is to change the chainlength( = maxchainlength) recordfield in the hoists symboldefinition then you need to replace the symbol of the hoist by the same in order trigger a refresh of the chainlength.
  10. You are right from a user view it makes more sense when the error appears for the first line. But in Python a statement can go to the next line when it is within brackets. So the python engine realizes that something is wrong when it suddenly sees a declaration in the next line. This is valid for example: print ( "a" + "b")
  11. def callback(h): sym = vs.GetRField(h, "BrxHoist", "SymbolUsed") symH = vs.GetObject(sym) if symH: val = vs.GetRField(symH, "HoistObjectData", "Manufacturer") vs.SetRecord(h,"HoistObjectData") vs.SetRField( h, "HoistObjectData", "Manufacturer", val) vs.ForEachObject(callback, "(R IN ['BrxHoist'])") Here is a little scrip which I quickly put together. It attaches the record to each hoist and only fills in the manufactur. Could be done better but I hope this works for you.
  12. Within VectorWorks\VW28.0.2b(671358)_64\Plug-Ins\Marionette.vwr\Scripts\ (vwr is a zip archive) you can find the Marionette.py Put this one in the pycharm project and then use import Marionette in the script, then all the errors should dissappear. The same applies for the vs.py that you can find at the end of this page. Search for "IDE and Debugging Python Scripts" https://developer.vectorworks.net/index.php/Python Another trick to make development easier is to add the path of your custom node py to the script option (Tools->PlugIns->Scipt options..) and then import the py module into the actial marionette node instead of copying it everytime from the IDE.
  13. I also see no other way than RunTemp tool. You pass in the IID like this: gSDK->RunTempTool( Your_VWExtensionToolClass::_GetIID()); You could write the data of the tool into a static class member that you acces then from the menu command or which is saver you finsih the job in the ::PointAdded method of the VWExtensionTool.
  14. Hi, when editing vwstring files Git shows the message "no changes found" in the diff view, I know this has to do with the utf-16 encoding but all the solutions of stack overflow didnt help so far. Did anyone here figure out how to fix this? regards, Patrick
  15. With the new hoist you can use the "Select Symbol" Button in the OIP. If these hoists are legacy vectorscript Hoists they can be upgraded with the command: Tools->Utility->Convert Old hoists. regards, Patrick
  16. I think the conversion is not correct, try it with: rgb16bit = rgb8Value * 257; 255 * 257 = 65.535
  17. What you could try is to put it temporaly in a folder before exporting and see if ExportResourceN maintaince the structure. Another solution I can think of is opening the lib file and create the folder. Unfortunately this can not be done silently so the user will see the file poping up for a second. if ( gSDK->OpenDocumentPath( fileID, true)) { // DoStuff gSDK->DoMenuName("Save", 0); gSDK->CloseDocument(); gSDK->HandlePendingUpdatesAndActivates(); //workaround for bug in OnFileContent: to trigger closedocument }
  18. Do you usualy copy the whole content out of the symbol, then maybe "Modify->Convert to Group" is what you need.
  19. In the list of the linked post I could find "Purge Items", maybe that works for you.
  20. Just stumbled over the vs-py rosetta stone, in case you dont already know it: https://developer.vectorworks.net/index.php/User:CBM-c-/VS-Py_Rosetta_Stone
  21. The trouble is caused by the special character in node "Info/Bemerkung" remove the "/". The error message was hard to understand.
  22. When I want to see the implementation of a SDK function I always need to open the cpp file by the explorer like "..VW2023_WIN64\SDKLib\Source\VWSDK\VWFC\Tools\ProgressDlg.cpp". Does any one know the trick to jump directly with visual studio to the source like you can do on the local cpp files? I tried it with adding the directory to "VC++ Source Directories" and "Additional Include Directories" but that didn't help. regards, Patrick
  23. I think it would be more easy to save the most recent created handle + timestamp as static parameters. If the move event is within a specific time after the create ignore it.
  24. This should do it: https://developer.vectorworks.net/index.php/VS:IsObjectFlipped regards, Patrick
×
×
  • Create New...