Jump to content

PatW

Member
  • Posts

    85
  • Joined

Reputation

33 Great

1 Follower

Personal Information

  • Occupation
    Software Engineer
  • Location
    Germany

Recent Profile Visitors

2,465 profile views
  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
×
×
  • Create New...