Jump to content

Maarten DE

Distributor
  • Posts

    89
  • Joined

Reputation

42 Great

Personal Information

  • Location
    Belgium

Recent Profile Visitors

1,264 profile views
  1. Just thinking out loud here, but wouldn't a 2D Path PIO be better in this case? That way you can calculate the angle between each consecutive line segment of the poly.
  2. In the past FIn3D( wallHandle ) worked to get the first inserted object in the wall. NextObj will get you the next etc. I just did a quick search and here's an example that you might change for your needs:
  3. And this does not work, so I guess they need to overlap? PROCEDURE Test; VAR poly1, poly2, polyOut : HANDLE; BEGIN Poly( 0,0, 10,0, 10,10, 0,10 ); poly1 := LNewObj; Poly( 10,0, 20,0, 20,10, 10,10 ); poly2 := LNewObj; polyOut := CombinePolygons( poly1, poly2, 1 ); END; Run(Test);
  4. Seems to work fine here... Windows 10 VW2024. PROCEDURE Test; VAR poly1, poly2, polyOut : HANDLE; BEGIN Poly( 0,0, 10,0, 10,10, 0,10 ); poly1 := LNewObj; Poly( 5,5, 15,5, 15,15, 5,15 ); poly2 := LNewObj; polyOut := CombinePolygons( poly1, poly2, 0 ); END; Run(Test);
  5. This looks like a webdialog. As far as I know, only possible with the SDK (c++) to create that dialog. The content of the dialog is html etc.
  6. I see, I tried it now too and indeed, it doesn't close the dialog in the LB events... Sorry, I'm out of ideas.
  7. I haven't tried it in a LB, but we force-close our dialog calling currentDialog->OnDefaultButtonEvent();
  8. I rarely write VS nowadays, and if I do I use the build-in VS editor of VW which I think works pretty good for the things I need to do. So I'll not update that file anymore, but feel free to do so! BTW, I found the other file, it needs to be placed here: C:\Users\*yourUserName*\AppData\Roaming\notepad++ . This way you can use Vectorscript instead of Pascal. But be aware, this file is from 2014, so same as that other file, it's outdated, but feel free to add the new functions to it. userDefineLang.xml
  9. On Windows you can use Notepad++. Fresh installed you can use the Pascal Syntax highlighting, that sure helps a lot for the readability. If you want VectorScript syntax highlighting and auto completion, you need to add a few files. Here's some more information but it seems all the download links are down... 😞 However, it seems my version can still be downloaded from Notepad++ itself: https://github.com/notepad-plus-plus/userDefinedLanguages/blob/master/UDLs/VectorScript_byMaarten.xml , I haven't checked if it still works though...
  10. A very dirty way to save you some time: Change the document units in the beginning of your script to whatever unit your dimensions inside your script are and at the end of the script restore them. However, I wouldn't recommend this, it wouldn't surprise me this unit change would trigger some recalculations of other objects inside the drawing, so it can slow down your plug-in. But if it's for personal use and you are aware of this, it might be a solution. PROCEDURE Example; VAR unitsPerInch : REAL; BEGIN { get original document units } unitsPerInch := GetPrefReal( 152 ); { all the dimesions in this script are in mm, so set document units temporary to mm } SetPrefReal( 152, 25.4 ); { the script } Rect(-100, 100, 150, -150); { restore original document units } SetPrefReal( 152, unitsPerInch ); END; Run(Example);
  11. 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.
  12. 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");
  13. 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 🙂 .
  14. 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.
×
×
  • Create New...