Jump to content

Hippocode

Member
  • Posts

    775
  • Joined

  • Last visited

Everything posted by Hippocode

  1. https://developer.vectorworks.net/index.php/VS:GetObject Since the symbol definition is unique you can get the handle using its name. Be sure to verify the object type.
  2. It will be part of the VectorMEP 2022 release which should be available during September 2021.
  3. Yes this is only possible using the SDK. You could create a small SDK project that runs a specific python script on startup or any other event if you don't want to bring over the full script.
  4. You could have a script traverse all the rectangles in that layer, and number them in sequence for you. On default that would be stacking order, but you could also use coordinates to define the order instead, like relative position.
  5. Well how I see it this is about two main functions. You need to automate the creation of certain objects (layers, rooms, sheets) You need to update the data of these objects. I'd assume this external info could change during the project development like updating room names. The input for both could be based from Excell or a Worksheet (imported Excell) or any input dialog whatever fits your needs. Both can be done with Vectorscript. A lot can go wrong so It'll be trial and error to develop this. FYI, I'm working on a new plug-in that allows you to export object data (for instance all rooms with their name, custom parameters etc) to Excell. Modify or append this data in Excell and import it back into the drawing, updating all these objects with the new data.
  6. For a simple standard a basic file or template as mentioned earlier is the way to go. If you need it to be more flexible with additional data, or generic from a source like Excell yes a script is a good option. It should be possible iterating all the cells from a Worksheet and do something with it.
  7. Think of the OnCursorAction triggers as a tool, you need to start it before the others will be triggered. And it starts with triggering a controlpoint by clicking/hovering it I guess. The other functions just show the images and text and decide if they should be visible, those are triggered constantly probably. I believe non parametric control points have positive index values, parametric ones negative. you can mix the use of them but it's important to return true/false properly @ IsDefaultCursorHandled Sint32 Index = context->GetCustomPtClientID(); // Index of CP I believe there are a lot of inconsistencies in those interfaces. For me I know that ICursorHandleActionContext::GetObject not always returns the effective object (or didn't in the past). For that reason I keep a copy of the handle in the interface itself and update it whenever GetObject does return a value in any of those functions. This ensures the other functions know which object we are managing the controlpoints for regardless of the provided context.
  8. I'm using the CParametricCustomBar wrapper class instead. This example comes from a cursor event that shows and allows to change the angle between two lines. I initiate it on OnCursorAction_MouseDown on first click fAngleBar.ClearFields(); fAngleBar.AddField("A:"); fAngleBar.SetFieldLock(0, false); fAngleBar.Create(); fAngleBar.SetUp(); fAngleBar.Install(); On any other click, within the same function I close it because what I was doing has completed. fAngleBar.Release(); while mousemove I modify the value to match the situation: gSDK->CustomBarSetFieldAngle(fAngleBar.GetCustomBarID(), 0, Utility::GetAngleBetweenVectors(-V1, VDir));
  9. You can handle creation/deletion/position as mentioned on that page. Depending on how flexible this should be I do this on kobjectCreated event or in the recalc event. But for managing the images, displayed hover text and other specific actions I advice to use the IProviderCursorHandles interface. This also replaces the old code you mentioned. The interface will catch these events.
  10. Hi Julian I have only tested this with the SDK but this is the equivalent function in VS. https://developer.vectorworks.net/index.php/VS:EditObjectSpecial The kObjXPropSpecialEditEditGroup constant should get you into the profile group. I'm calling this from a button widget on the OIP. const TObjSpecialEdit kObjXPropSpecialEditDefault = 0; const TObjSpecialEdit kObjXPropSpecialEditCustom = 1; const TObjSpecialEdit kObjXPropSpecialEditProperties = 2; const TObjSpecialEdit kObjXPropSpecialEditReshape = 3; const TObjSpecialEdit kObjXPropSpecialEditEditGroup = 4; const TObjSpecialEdit kObjXPropSpecialEditSpecial = 5;
  11. It seems that the editing dialog / OIP controls the data and since the record is read only you won't have access. I couldn't find anything in the SDK related to this special hidden record type (besides some kludge calls) . I find it interesting myself as I'd like to have readonly records as well; @Vlado Is this feature exposed to VS / SDK?
  12. The typical way is to hide it from the resource browser. Just like object format records are not visible. If that isn't sufficient you might try working with catching the kNotifyRecordChange event but I doubt you can catch the exact change, you could compare this from a default sitting in your resource library.
  13. For exactly the same reason I did save this data within the plug-in itself. I attached the data to the object handle itself or using parameters. Because the objects are accessible you can determine versions etc..
  14. I believe when creating a symbol from the VWSymbolObj wrapper class it's not properly attached to a container, in your case the active layer. Try additing it manually after you create the symbol, and before you reset it using "gSDK->AddObjectToContainer"
  15. Have a look in this topic: If you don't create something, your can use other functions to traverse the workspace, find the palette by name or identifier and use that handle to show/hide these.
  16. Well it could be any of these settings. I'm setting all these to show the palette in a specific spot. bool inTearOffState = false; bool inTopPosition = false; Sint16 ToolinSortStyle = 1; Sint16 ToolinViewStyle = 2; Sint16 ToolSetinSortStyle = 1; Sint16 ToolSetinViewStyle = 2; bool inVisibilityState = true; bool inWindowShadeState = false; EWindowHomeCorner inHomeCorner = EWindowHomeCorner::eWindowHomeCorner_ScreenUpperLeft; Sint16 inHorizontalOffset = 0; Sint16 inVerticalOffset = 0; ViewRect screenRect; gSDK->GetScreenSize(screenRect); ViewPt Center = screenRect.Center(); inHorizontalOffset = +Center.x; inVerticalOffset = +Center.y; if(VCOM_SUCCEEDED(errorCode)) errorCode = pToolPalette->SetTearOffState(inTearOffState); if(VCOM_SUCCEEDED(errorCode)) errorCode = pToolPalette->SetToolSetPosition(inTopPosition); if(VCOM_SUCCEEDED(errorCode)) errorCode = pToolPalette->SetToolSetSortStyle(ToolSetinSortStyle); if(VCOM_SUCCEEDED(errorCode)) errorCode = pToolPalette->SetToolSetViewStyle(ToolSetinViewStyle); if(VCOM_SUCCEEDED(errorCode)) errorCode = pToolPalette->SetToolViewStyle(ToolinViewStyle); if(VCOM_SUCCEEDED(errorCode)) errorCode = pToolPalette->SetToolSortStyle(ToolinSortStyle); if(VCOM_SUCCEEDED(errorCode)) errorCode = pToolPalette->SetVisibilityState(inVisibilityState); if(VCOM_SUCCEEDED(errorCode)) errorCode = pToolPalette->SetWindowShadeState(inWindowShadeState); if(VCOM_SUCCEEDED(errorCode)) errorCode = pToolPalette->SetHomeCorner(inHomeCorner); if(VCOM_SUCCEEDED(errorCode)) errorCode = pToolPalette->SetHomeCornerOffset(inHorizontalOffset, inVerticalOffset);
  17. Is there any way we can provide a link to our own help documentation/wiki when creating tools with the SDK? When you hit F1 on default tools you end up on the specific article explained in the Vectorworks help.
  18. Make sure that the workspace interfaces are initiated correctly. This is a snippet of my workspace wrapper class and confirmed to be working: VCOMPtr<IWorkspaces> pWorkspace(IID_Workspaces); // Get current workspace file name. TXString workspaceFileName; gSDK->GetCurrentWorkspaceFile(workspaceFileName); // Current workspace full file name. TXString workspaceFullFileName = workspaceFileName + ".vww"; VCOMPtr<IWorkspaceFile> pWorkspaceFile(IID_WorkspaceFile); if(pWorkspaceFile && pWorkspace) { errorCode = pWorkspaceFile->Open(workspaceFullFileName, kFileReadPermission); VCOMPtr< IWorkspaceToolPalette > pToolPalette; VCOMPtr< IWorkspaceTool > pTool; TXString ToolPaletteName = "VectorMEP"; TXString ToolPaletteIdentifier; if(VCOM_SUCCEEDED(errorCode)) errorCode = pWorkspace->CreateIdentifier(VectorWorks::Workspaces::EWorkspaceItemType::eWorkspaceItemType_ToolPalette, ToolPaletteIdentifier); if(VCOM_SUCCEEDED(errorCode)) errorCode = pWorkspaceFile->CreateToolPalette(ToolPaletteIdentifier, &pToolPalette); pToolPalette->SetDisplayName(ToolPaletteName);
  19. In short: Only the creator of the voids requires a VectorMEP license. All the other communication tools are free. The mapping tool allows you to predefine filters of objects you would like to compare. For instances all pipes versus floors. You can even define a parameter value to filter even further. You can also setup additional dimensions when creating voids, based on some categories. If you map a "pipe" as "Plumbing" category, the additional offsets will be used as set in the dimensions dialog. Person A creates the voids by selecting the mappings. Person B references the file that contains the voids. Person B can now manage the status and comments of these voids within his own project. Person B can export his modifications to an XML file. Person A imports the XML file, which updates the status and any comments of each void. This process can be repeated. Note the the openings are only created for those objects that support it, but in both cases the void object will be present. You can create unlimited void mappings based on object names and optionally based on a parameter value. Also supports custom objects. I'm about to update some of it's functionality so wait a tiny bit if you plan on testing it out.
  20. This plug-in is part of our VectorMEP bundle. It's not meant to be a clashing tool, but rather a tool that automates openings and allows you to communicate about it. While the example shows automated voids between pipes and walls, the tool allows you to select any kind of "clashing" object, thus not limited to MEP design. It also allows you to export/import voids between users as a communication tool. You can add comments, accept or deny void suggestions etc... Showcase video:
  21. If they are also "outside" the container of your PIO, so not part of it, you need to attach them to the PIO's container after duplication.
  22. Couldn't find any constant to read that property in the minicads file. I vagely remember when building lists the filename was used as prefix or something similar but that would require you to build a huge list of all available resources, which is still a valid possibility. From looking at this article, one of the other similar functions will probably return the filename within the symbolname if from an external file, but it might only work if those are duplicate: http://developer.vectorworks.net/index.php/VS:GetActualNameFromResourceList You could also try using the IResourceManagerContent VCOM interface to search for the specific symbols, maybe some of the functions also return the filename.
  23. I faced a similar issue trying to find out if some of my custom plug-ins were referenced or not. I used the following approach which seemed to work as the "IsObjectFromReferencedFile" function didn't (always) return the expected results you can just look at the object's layer name instead. // Referenced? fInfo.IsReferenced = gSDK->IsObjectFromReferencedFile(this->GetThisObject()) || gSDK->IsViewportGroupContainedObject(this->GetThisObject(), kViewportGroupCrop); // Since above doesn't work :( MCObjectHandle hLayer = this->GetParentLayer(); if(hLayer && VWLayerObj::IsLayerObject(hLayer)) { VWLayerObj L(hLayer); TXString strLevel = L.GetName(); fInfo.IsReferenced = strLevel.Find("NNA") != -1; // NNA seems to be put in all referenced layers, so any object that is referenced matches this parent layer name. }
  24. 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.
×
×
  • Create New...