Jump to content

Maarten DE

Distributor
  • Posts

    69
  • Joined

Everything posted by Maarten DE

  1. The png's inside the Vectorworks.vwr file are also 72 and 144 dpi, and in our tools too, so that should not be an issue.
  2. In our code, we've added the .png extention, maybe that's the reason it doesn't work in your end? TXStringArray imageSpecs; imageSpecs.Append("MyTool/Images/MyImage.png");
  3. For the images on mac, you need to ad "@2x" to the image name, and that icon needs to be double the size of the normal image. So: YourToolName.vwr/Images/imageName.png YourToolName.vwr/Images/imageName@2x.png About setting up the mac, I can't help much because I struggle with that too 🙂 .
  4. This is not that easy, the most difficult part is overwriting the default behaviour in VWToolDefaultPoint_EventSink::HandleComplete(). This means you need to cover all the cases yourself. I had to do it too for one of our tools to go from a point mode to a line mode. However, if the object should not be inserted into a wall, it will make things a lot easier. Anyway, these functions need to be adjusted: VWToolDefaultPoint_EventSink::Init() SDefaultPointToolInfo toolInfo = this->GetToolInfo(); // Set the mode groups this->SetToolInfo( toolInfo ); VWToolDefaultPoint_EventSink::DoSetUp() // Set all the button images VWToolDefaultPoint_EventSink::GetStatus() IToolStatusProvider::GetTwoPointToolStatus() etc VWToolDefaultPoint_EventSink::DoModeEvent // When user clicks Mode Bar. VWToolDefaultPoint_EventSink::PointAdded() VWToolDefaultPoint_EventSink::PointAdded(); // Needs to be called when the last click is done (depending on your mode) // You can get the num of clicks that already happened with: this->GetToolPointsCount(); VWToolDefaultPoint_EventSink::HandleComplete() I think this is the minimum of functions you need to implement.
  5. Since you know where the matrix is located in the aux list, you should be able to adjust it using the aux functions: https://developer.vectorworks.net/index.php/Category:VCOM:VectorWorks:ISDK(Auxiliary_and_Data_Objects) I thought I had some code where I adjusted something in an aux list, but I can't find it anymore...
  6. Or, if you really want to count actual objects (even if they don't have any geometry), you could create a line with zero length and attach a record to that. We do that to be able to count subparts (for example, when you have a 2D only representation, and the objects above the cutplane will not be drawn, but you still want them in your worksheet, you could use this methode).
  7. Maybe you can use a default library? In that library you have symbols of screws etc and your PIO imports the one you need and uses them. Good thing is, you don't need to create any geometry in your PIO, only place the needed symbol instance. They also show up in a worksheet (and yes, I know, these are bolts, not screws 🙂 ). BTW, this tool is very fast, I filled in 1000 in numScrew and it takes less then a second to recalculate. PIO inside PIO would not be a good idea, because each nested PIO will be recreated (thus redraw the geometry) when you reset the main PIO. So it will be slower than just drawing the screw geometry inside the main PIO. Something else you can do, inside your PIO, create the geometry once, and duplicate it the number of times you need it, but I don't see it making such a big difference than creating the geometry inside a FOR loop. In this case you do need to have a way to make these inobject elements show up in a worksheet, you can do this by attaching a record to them. Or, if it's just quantity, write that quantity to a parameter of the PIO and show that inside the worksheet. I'm sure there are other ways of doing this too, these are the one I could think of 🙂 .
  8. To get the Object Type, you could use the "Debug List View Ex..." command. Create the resource you want to get the type of and give it a name, and in "Debug List View Ex...", use "Find Object..." to search for its name, and in the list you can see the Object Type.
  9. This works for me... PROCEDURE ResListTextureStyles; VAR listID, numItems: LONGINT; BEGIN listID := BuildResourceList( 106, 0, '', numItems); Message(numItems); END; Run(ResListTextureStyles);
  10. If my memory is not failing me, it was gSDK->GetTextureMappingInfoN();
  11. Hi Stefan I'm not sure it will work in your case because we create our widget via: void IProviderShapePane::Init(CodeRefID objectID, IExtendedProps* extProps) { IWidgetsEditProvider* widgetsProvider = NULL; if ( extProps && VCOM_SUCCEEDED( extProps->GetObjComponentTypeWidgets( objectID, kObjectRootComponentTypeID, widgetsProvider ) ) ) { widgetsProvider->AddWidget( kWidgetID_SizeType, .... not automatically via a kFieldPopUp. But this is how we fill the pull down dynamicly: void IProviderShapePane::Update( IWidgetsProvider* widgetProvider ) { SWidgetDefinition* pSizeTypePU = widgetsProvider->GetWidgetByID( kWidgetID_SizeType); IWidgetDataPopup* pPopupData = dynamic_cast<IWidgetDataPopup*>(pSizeTypePU->fpWidgetData); pPopupData->Clear(); std::vector<TXString> listOptions = this->GetListOptions(); for ( size_t i = 0; i < list_sets.size(); i++ ) pDataSetPU->Add( TXString::ToStringInt( i + 1 ), listOptions[i] ); } Off course, this is not dimming or disabling, but it might work too for you?
  12. Wow, be aware this is a very difficult thing to do, it will take some time to implement this. In VW, you have all sort of 3D geometry, al with different ways of saving their data and graphical attributes. So you'll need to cover all cases... And every year things get added/changed in VW, so maintening this will take some time too. I think it's best to contact VW inc for this, they might be able to tell you what other export menu commands do and tell you how to implement this correctly in a safe way. @Hugues @Vlado @SteveJ
  13. virtual void ForEachObject( short traverseWhat, GS_ForEachObjectProcPtr action, void *actionEnv) action is called for all object that match the traverseWhat criteria, you need to filter the type that you want in that function. actionEnv can be used to pass on any kind of data you want from your "main" function to this action function. Here's a rough example, this is how you could get a list of all lines in the drawing. struct SMyLineData { std::vector<MCObjectHandle> listLines; }; void ApplyCritIsLine( Handle h, CallBackPtr, void *data ) { SMyLineData* lineData = (SMyLineData*)data; if ( gSDK->GetObjectTypeN( h ) == kLineNode ) lineData->listLines.push_back( h ); } void foo() { // save all lines in the drawing in lineData.listLines SMyLineData lineData; gSDK->ForEachObject( allObjects | descendIntoAll, ApplyCritIsLine, &lineData ); // do something with that list. } However, instead of saving it in a list, you could also do your operation directly in your action function. For resources, like texture definitions, you need to use gSDK->BuildResourceListN() or any of the other resource list functions/classes. But I'm not 100% sure this is actually what you need, do you want to go through the list of all objects inside a container?
  14. Have a look at AutoIt (https://www.autoitscript.com/site/), we used to use it a lot to automate VW, all the things we couldn't do via VS or the SDK, we did with AutoIt (opening dialogs, filling in dialogs, clicking buttons, moving dialogs and palettes around, taking screenshots, importing and exporting etc). It's a very powerfull thing. However, I haven't used it in almost 10 years, mainly because we don't need it anymore, with the recent versions of VW we could do the things we needed to do via the SDK. So I'm not sure how well this program aged, the last version is from 2018... Anyway, with the "AutoIt Window Information Tool" you can get the name/ID of the dialogs/palettes. That ID can then be used to resize and reposition those dialogs/palettes. I did a quick test and this is how you can move and resize the Resource Browser: WinMove("Resource Manager", "", 100, 100, 800, 600) However, I couldn't find how to move the palettes around, so I think you need to do this with actual MouseClickDrag operations. And perhaps you can use the "recorder" for that. Just record the things you normally do and let AutoIt generate the code. Adjust it here and there and you should be good to go. However, I just checked and the recorder is not part of the installation anymore, but you can still find it here: https://www.autoitscript.com/forum/topic/176009-where-is-au3recordexe/
  15. Thanks @tbexon, good catch! I've adjusted it. It seems those other 9... where wrong too, I changed them to 6... too.
  16. If I remember correctly, we had to add a Progress dialog for our bulk translation of files, otherwise VW crashed. But this issue was almost 10 years ago, not sure it's still an issue. Also, I've found this in our code, it might be the fix to the same issue you are having? gSDK->CloseDocument(); gSDK->HandlePendingUpdatesAndActivates(); //workaround for bug in OnFileContent: to trigger closedocument
  17. When reading this, I'm not sure why nobody is using two workspaces like I suggested 11 years ago. Make a copy of your workspace, use one for a one monitor workspace, the other for working with a beamer (or multiple monitors). For each workspace, you can save the possition of the palettes (right-click in drawing area -> Palettes -> Save Palette positions). Or doesn't this work on mac? I'm aware this will not fix Jeremy's fresh install issue, but can't you re-use your workspaces? Or like Peter suggested place them in a Workgroup folder?
  18. The problem that I have with the mode bar (and also the mode bar in the Smart Option Display) is that's only in one direction, that's why I really like the ideas I'm reading here👍. They could also make it possible to have the modes in a revolver. For example, hit "U" once to activate the first mode group and start scrolling. See this topic:
  19. Yes, I had a simular idea but this time for tools, just having a quick pick carousel that can be controlled with the scroll wheel of the mouse. But like you suggest, if they are just open slots and the user can place whatever they like in it (like resources, but also tools, quick prefs, snaps, ...), I think this is a very powerfull thing. Now that the monitors get bigger and bigger, it makes less sense to have palettes on the edge of the monitor, it takes way to long to travel al the way to there (also tbad for the eyes and neck), the most used things should be available in the drawing area, on the mouse cursor. And I like the idea of being able to apply a shortcut to each slot.
  20. A symbol is type 15, 6 is an arc. Not sure if this is the only mistake, I haven't run the script. You could always try to debug your code, this could help you to see where it fails.
  21. We made a function to import resources, that is using EImportResourceConflictResult, but it will prompt the user in case of a name conflict (so not 100% what you're looking for, what you ask for, I haven't come across anything like that in the SDK). MCObjectHandle ImportNestedResourceFromFile( VCOMPtr<IFolderIdentifier> idFolder, TXString extrFolder, TXString filename, eVWObjectType::Type vw_type, TXString name ) { IResourceManagerContentPtr importResManContPtr = nullptr; importResManContPtr.Query( VectorWorks::Extension::IID_ResourceManagerContent ); importResManContPtr->InitByTDType( (TDType)vw_type ); importResManContPtr->AddContent( EFolderSpecifier::kDefaultsFolder, extrFolder ); TXString fullPath; idFolder->GetFullPath( fullPath ); if ( importResManContPtr->SetSelectedItemText( name, fullPath + filename ) ) { MCObjectHandle ret = importResManContPtr->ImportSelectedResourceToCurrentFile( VectorWorks::EImportResourceConflictResult::eImportResourceConflictResult_AskWithUI, true ); DEBUG_Check2( ret != nullptr, (char*)"ERROR: Resource: %s cannot be imported to current file", (const char *)name ); return ret; } return nullptr; }
  22. I don't thinkg so, I have the feeling this is dealt with by the VS API, all these scripts messages 0. PROCEDURE Test; VAR h : HANDLE; BEGIN Message(h); END; Run(Test); PROCEDURE Test; PROCEDURE Proc; VAR h : HANDLE; BEGIN Message(h); END; BEGIN Proc; END; Run(Test); PROCEDURE Test; VAR b : BOOLEAN; FUNCTION Func : BOOLEAN; VAR h : HANDLE; BEGIN Message(h); Func := false; END; BEGIN b := Func; END; Run(Test);
  23. This does work for me, but I'm not 100% sure it's the best way to go... // Create an object and delete it. MCObjectHandle locus = gSDK->CreateLocus( WorldPt( 0, 0 ) ); gSDK->DeleteObject( locus ); // Check if object still exists in the drawing. VWObject obj( locus ); if ( obj.GetType() == 0 ) { // Object does not exist in the drawing anymore. }
  24. It might be a long shot, but if you take that part out, does the restriction work again? Because in our case, it fixed several issues (but again, I'm talking about several years ago, VW changed a lot since then).
  25. Not sure if it helps, but we had something alike several years ago, and the reason for it was that we adjusted our dashed preview when the user hoovered over a wall (for example, for some configurations, the frame should use the same thickness of its parent wall, so when the user hoovered over that wall, dashed preview was adjusted so the frame got the same thickness as the wall). Is see in your video that your dashed preview does change too when the user hovers over the wall (and at that moment, that red dashed line is gone too). We had to take the code that adjusted the object while hoovering over the wall out to fix the issue. I had a look in our repository but I couldn't find the fix anymore.
×
×
  • Create New...