Jump to content

Maarten DE

  • Posts

  • Joined


34 Great

Personal Information

  • Location

Recent Profile Visitors

702 profile views
  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.
  • Create New...