Jump to content

Hippocode

Member
  • Content Count

    749
  • Joined

  • Last visited

Everything posted by Hippocode

  1. I can provide you with some other samples if you need some. They come in handy sometimes, the benefit is that such a tiny script has access to your complete SDK. If you have SDK bases plug-ins you can use this to make certain data or functionality accessible through VS. I have made several of those for my plug-ins. e.g.: The ability to activate our license to use our software for the current session, bypassing our default activation method. It requires a custom hash to unlock the current specific day.
  2. Using the plug-in manager to install the plug-in did work, thank you for the suggestions. I'm a bit surprised this works but manually installing doesn't. Maybe Vectorworks removes the quarantaine of the file while copying.
  3. I removed the quarantaine of the buildvwr tool instead of disabling scrutil so I can see the error messages myself. Signing alone doesn't do it and I'm unable to create an archive of the plugin in order to get it notarised (Also tried it on the TesterModule sample). Has anyone done this before? I'll see if I can do it manually using terminal instead.
  4. All of them as zipped files (download available on a website or Google Drive). Some bundles support the third party plug-in installer within Vectorworks, which requires the files to be zipped. I also zip them because some browsers/cloud solutions rename extensions and capital letters in the VWR resource on download/zip which breaks the plug-in. I can't really imagine doing this without these files being zipped ūüėģ
  5. Thanks, this helped me out on the developer side. But clients are now reporting Vectorworks prevents them of using the plug-in because of restrictions obviously... Do we need to modify some settings of our projects for them to be accepted somehow?
  6. Hi There is not much to be done, as most of it should be handled by the default implementation. I use a custom class (VWStyledParametricObj) to help with this which I attached (had to zip it as the file extensions weren't allowed). This class also holds some comments on what each action is for. This is an example of how I implemented it: EObjectEvent ElectricalDevice_EventSink::OnEditPluginStyle(MCObjectHandle symDefHandle) { return VWStyledParametricObj::OnEditPluginStyle_Default(symDefHandle); } EObjectEvent ElectricalDevice_EventSink::OnCreatePluginStyle(MCObjectHandle symDefHandle) { return VWStyledParametricObj::OnCreatePluginStyle_Default(symDefHandle); } EObjectEvent ElectricalDevice_EventSink::OnUpdateStyledObject(MCObjectHandle symDefHandle) { // Copy over the saved references... EPluginStyleParameter ParameterStyle = gSDK->GetPluginStyleParameterType(fhObject, "__ManageOperatingAreas"); if(ParameterStyle == kPluginStyleParameter_ByStyle) { VWSymbolDefObj symDef(symDefHandle); MCObjectHandle hObject = symDef.GetFirstMemberObject(); if(hObject && VWDeviceObj::GetDeviceType(hObject) != eDeviceType::kUnkownDevice) { sOperatingAreaArray Areas; OperatingArea::Get(hObject, Areas); OperatingArea::Save(fhObject, Areas); } } return VWStyledParametricObj::OnUpdateStyledObject_Default(symDefHandle); } EObjectEvent ElectricalDevice_EventSink::OnFinalizeCreatePluginStyle(MCObjectHandle symDefHandle) { /*EObjectEvent Result =*/ VWStyledParametricObj::OnFinalizeCreatePluginStyle(symDefHandle, VWDeviceObj::GetStyleMap()); return VWStyledParametricObj::OnFinalizeCreatePluginStyle_Default(symDefHandle); } EObjectEvent ElectricalDevice_EventSink::OnFinalizeUpdateStyledObject(MCObjectHandle symDefHandle) { return VWStyledParametricObj::OnFinalizeUpdateStyledObject_Default(symDefHandle); } StyledPlugins.zip
  7. I believe this does sort of the same, but only on the visible part of the screen instead of all objects: void Utility::RefreshView() { WorldCoord perspectiveDistance, clipDistance; WorldRect clipRect; gSDK->GetPerspectiveInfo(gSDK->GetActiveLayer(), perspectiveDistance, clipDistance, clipRect); gSDK->RedrawRect(clipRect); } Also, I tend to draw all temporarily objects using these two functions on these events: void X_EventSink::DoSetDown(bool bRestore, const IToolModeBarInitProvider* pModeBarInitProvider) { this->ClearAllToolInteractiveObjects(); } void X_EventSink::MouseMove() { this->UpdateToolInteractiveObjects(); } void X_EventSink::ClearAllToolInteractiveObjects() { VectorWorks::IToolInteractiveDrawPtr toolInteractive; gSDK->GetCurrToolInteractiveDraw( & toolInteractive ); if (toolInteractive) { toolInteractive->ClearObjects(); } } void X_EventSink::UpdateToolInteractiveObjects() { VectorWorks::IToolInteractiveDrawPtr toolInteractive; gSDK->GetCurrToolInteractiveDraw( & toolInteractive ); if ( toolInteractive ) { size_t ptCnt = this->GetToolPointsCount(); if ( ptCnt > 0 ) { // Create full path VWPolygon3D poly; for(size_t i=0; i < ptCnt; i++) { poly.AddVertex(this->GetToolPt3D(i)); } VWPoint3D MousePosition; this->GetToolPtCurren3D( MousePosition ); poly.AddVertex(MousePosition); if((fModeBarState[ModeGroup::Mode_H_Outline] != eHAlign::kHAlign_Center) || (fModeBarState[ModeGroup::Mode_V_Outline] != eVAlign::kVAlign_Center) || fSlope != 0) { eHAlign HAlign = static_cast<eHAlign>(fModeBarState[ModeGroup::Mode_H_Outline]); eVAlign VAlign = static_cast<eVAlign>(fModeBarState[ModeGroup::Mode_V_Outline]); poly = MathUtilsExt::GenerateOffsetPolygon(poly, HAlign, fH_Offset, VAlign, fV_Offset, fSlope); } VWPolygon3DObj polyObj( toolInteractive->GetObject( qPolyNode ) ); polyObj.SetPolygon(poly); } } }
  8. How do we properly support IFC mapping for our custom objects? - Do we need to add default mapping sets on document open? I noticed that the default mapping dialog only shows native objects. - Do we need to handle the mapping ourselves or is it done by Vectorworks on export? Is there a specific event triggered to apply the mapping or should we just do it in the Recalculate event?
  9. Assuming this won't happen anytime soon... this could be solved by a simple script that lets you filter your selection, by choosing one of the records attached to your selection from a drop down menu.
  10. Is this VS or the SDK? Where are you filling the drop down? I don't have this issue with the SDK. It might be the location/event where you fill the dropdown?
  11. Any component that can be hosted into a wall is actually being duplicated inside while the original is removed. This sounds very unlogical but I don't know the reason behind it. That might be causing that row being removed.
  12. I don't think there is a function available that can do it, as it's default behaviour. I believe the only way is to force a class (or custom settings) on your subobjects. My guess is that the recalculate event uses the parent class for all created content in that container.
  13. I don't think you can either. In vectorscript tools are generated automatically fitting the plugin type. In the SDK, these are separate and can be customized.
  14. Yes our SymbolObject plug-in does exactly that. It can be very useful for indicating shafts and other components that have exact the same composition through multiple layers. You can choose to show the symbol on any combination of layers from a selection box. This is made possible by using the proxy object functionality and works best with 2D symbols only. The object duplicates it's content on all the chosen design layers. While you can select and modify this object on any of these layers, it is one unique object. It is also possible to count all the occurrences when using worksheets.
  15. Sadly I won't be able to come to the DS this year, but I do like the idea. I'd say it should be even part of the DS, but I guess our numbers are probably to small for Vectorworks to invest their valuable time of the summit. Then again my opinion is that if you have zero custom scripts/tools/addons active in your workspace, you are doing it wrong and need help
  16. From what I understand, plug-in styles are only supported if your object matches a unique ID hardcoded into Vectorworks (by request). It is required for your object to be recognized by the functionality.
  17. If you debug you should be able to see on which line the error occurs? Also, you don't need to define "poly" on declaration.
  18. if object A is the parent and it creates object B inside of it (parent - child) there is no need of catching it with a unique name, as you have a handle when creating it. That is, unless you have your object A set not to automatically remove all it's contents on reset, on which case your interface manages it. This is used if you don't wat to recreate all the inner objects each time the object is reset.
  19. It only requires one argument, unless you want to specify a path/profile. Your object will be created and reset. Only after this creation the path will be attached and reset again. In any case, your object's code should be able to handle a NULL path. Can you post a bit more of the last steps before the crash occurs ? Could also be a recursive reset.
  20. Yes, I assume you are not veryfing the path handle. When your parent creates the child, it could be that the first reset is called before your path is assigned. If you just assume its a correct handle and cast it to a nurbs or poly you'll run into this. Since you talk about parent and child, can I assume you've set your plug-in not to remove it's content on reset? If not you do not need to get the handle by using a unique name.
  21. I usually add a class parameter that overrides the object class on object recalculation. I only do this when the current class does not match the class of the parameter to avoid infinite recursion as mentioned above. Though it could be that setting a class does not reset the object anymore, something changed about it a couple versions back.
  22. Your object origin is always 0,0 towards your object insertionpoint. Knowing that, for your object to show something at an absolute position in the drawing, all you need to do is substract the object position from the relative position of the part within the object. Say you want something shown absolute at A(50,50), your object is placed at B(25,25) => The inner component of your object should be placed at A-B. Keep in mind that this does not take in rotation, you should apply the transformationmatrix of the object instead for this to work.
  23. Assuming you have one instance of this symbol selected, you can use the active handle to retrieve the values, get the handle to the definition itself and overwrite them. From then on, any new placed instance will use the updated record information.
  24. A light object is not a parametric object, thus any data is not saved into a record. Instead, everything is saved as object properties. You can find the appropriate constants in the SDK definitions. Search for ovLight. It could be that just like in the SDK, VS also has wrapper functions available.
  25. Typically they should follow a logically order of events. kObjectExternalReset is called when an object reset is caused by another object. I assume the first reset is yours. For some reason, an additional reset by something else in the background is causing the other events. Some actions can cause multiple events because sometimes we want to do something on a specific moment when an object is changing. It could be that modifying text does that. I wouldn't worry to much about it unless you end up with unwanted behaviour.

 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

√ó
√ó
  • Create New...