Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

13 Good


About Hippocode

  • Rank
    500 Club

Personal Information

  • Location

Recent Profile Visitors

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

  1. 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
  2. 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); } } }
  3. 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?
  4. 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.
  5. 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?
  6. 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.
  7. 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.
  8. 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.
  9. 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.
  10. 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
  11. 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.
  12. 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.
  13. 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.
  14. 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.
  15. 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.


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