Jump to content

Tobias Döngi

Member
  • Posts

    12
  • Joined

  • Last visited

Reputation

8 Neutral

2 Followers

Personal Information

  • Location
    Germany

Recent Profile Visitors

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

  1. The first method is a callback function. That means VW will call it for every object matching the search criteria. So the handle is a pointer to one currently selected VW object. I strongly encourage you to use the small clipboard button. There you will also find a menu named "Procedures". Having a look at the "Object Info" topic provides you with vs.GetTypeN(h). You have to provide it with above mentioned handle and you'll get the object type. Yes you can but you have to create a resource list and import the symbol into the current document first. After that you can place the symbol within the drawing. math.tan() expects radians you are providing degrees. You can convert it by using math.radians(angle_a.)
  2. The call you're looking for is vs.ImportDXFDWGFile so your script could look like this: isBatch = True result = vs.ImportDXFDWGFile('C:\\155_01_237_1.dxf', isBatch) vs.AlrtDialog('Result: {}'.format(result)) Setting isBatch to 'True' avoids annoying config dialogs. For macOS you should experiment with the path specifier I'm sure you have to use slashes but haven't tried it. Warning: The online developer reference for this function is outdated, you should use the reference within the script editor accessed by the small clipboard with arrow button.
  3. You can configure the search criteria by clicking the small clipboard button within the script editor, like shown below:
  4. Hi Jayme, there is no specific method like vs.GetSelectedObjects() for retrieving the objects conveniently. Instead of that you iterate all objects in a specific context and match them against a search criteria. I.e. all rectangles in document or a given layer and so on. So what you want is traversing all objects in the current document and collect all selected ones. Following script does the trick: OBJECTS = [] def collect(handle): OBJECTS.append(handle) vs.ForEachObject(collect, '((VSEL=TRUE))') vs.AlrtDialog('Num selected objects: {}'.format(len(OBJECTS))) Check out those resources for additional help: https://developer.vectorworks.net/index.php/VS:ForEachObject https://developer.vectorworks.net/index.php/Python https://developer.vectorworks.net/index.php/VS:Function_Reference
  5. You can achieve that easily by writing "if 'BST' in outvalue:" As long as it's okay that the string can be at any position in outValue.
  6. Again, here too, in short: in the dialog, tab "Division", select one box, then click the symbol with the arrow for expanding the selection, until you have the right selection for the door you want to change. You can do this even faster by holding the alt key down while clicking the desired box.
  7. If you are trying to set the palette visibility on Windows then this call will not work at all. Please see my answer in above mentioned thread. You would have to retrieve the WindowsOSData, parse the XML, find the corresponding palette there and alter its visibility. As far as I know this cannot be done via SDK yet.
  8. It depends on which platform you are creating the new palette. Under Windows you cannot set the visibility state by API. This is due to the fact that NVI is using a third party module for rendering all the palettes. You can see this when opening a Windows workspace file in a text editor. There is a special tag WindowsOSData. That's a xml subsystem with own palettes and settings specific to the Windows platform. You can retrieve this data by calling: TXString newWinOSData; workspaceFile->GetWindowsOSData(newWinOSData);
  9. Hello, I'm using following code to create new tool palettes: VCOMError XGWorkspaceCreator::CreateNewToolPalette(const TXString& paletteName, IWorkspaceFile* workspaceFile, IWorkspaceToolPalette** newToolPalette) { VCOMError error = kVCOMError_Failed; if (workspaceFile) { TXString toolPaletteID; CREATE_TOOLPALETTE_ID(toolPaletteID, error); workspaceFile->CreateToolPalette(toolPaletteID, newToolPalette); (*newToolPalette)->SetDisplayName(XG::Win2MacString(paletteName)); } return error; } Where workspaceFile points to a workspace file within Vectorworks program directory.
  10. Cool, great tutorials and a lot of fun to learn something about modeling beside the normal hacker work 😉
  11. Ah great, never thought about that. Thanks for your help.
  12. As mentioned in the title I'm wondering what the method bool IResourceManagerContent::GetSelectedResourceIsDocument() does. My first thought that it validates if the selected resource is already in document proofed wrong after some debugging and importing resources and re-importing them. And what the name suggests if the selected resource is a document sounds somewhat weird. Can anyone help? Best regards Tobias
×
×
  • Create New...