Jump to content

MarcelP102

Member
  • Posts

    270
  • Joined

  • Last visited

Reputation

214 Spectacular

Personal Information

  • Occupation
    Architect
  • Homepage
    www.opzoom.nl
  • Location
    Netherlands

Recent Profile Visitors

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

  1. Thnx, got it working for now with the script below. Will test more later. PROCEDURE DrawToDelete; VAR H1, dummyH :HANDLE; PROCEDURE SelectThem(h :HANDLE); VAR vertX, vertY :REAL; i :INTEGER; BOOl :BOOLEAN; BEGIN FOR i := 1 to GetVertNum(h) DO BEGIN GetPolyPt(h, i, vertX, vertY); BOOL := PtInPoly(vertX, vertY, h1); IF BOOL = TRUE THEN BEGIN SetSelect(h); END; END; END; PROCEDURE DeleteThem(h :HANDLE); BEGIN DelObject(h); END; BEGIN Locus(0,0); dummyH := LNewObj; CallTool(-203); h1 := NextObj (dummyH); SetName(h1, 'MySelectionPolygon'); DSelectAll; ForEachObject(SelectThem, ALL); ForEachObject(DeleteThem, SEL=FALSE); DelObject(h1); DelObject(dummyH); DSelectAll; END; Run(DrawToDelete);
  2. I'm using the below script to let a user draw a square, name it and delete everything outside that object using LOC criteria. Unfortunately it also deletes polygon's that are within the square but it center point is outside it. That happens a lot with unregular shaped polygon, like the polygon representing multiple connected streets. I've tried everything but I'm unable to keep all the objects within the square. Basically I want it to work the same as the 2D selection tool while holding ALT. Any help? See attached file for a sample project. PROCEDURE DrawToDelete; VAR H1, dummyH :HANDLE; BEGIN Locus(0,0); dummyH := LNewObj; CallTool(-203); h1 := NextObj (dummyH); SetName(h1, 'MySelectionPolygon'); DSelectAll; SelectObj(INSYMBOL & INOBJECT & (LOC<>'MySelectionPolygon')); DeleteObjs; DSelectAll; DelObject(h1); DelObject(dummyH); ReDrawAll; END; LOCproblem.vwx Something else I've tried is to call the selection tool and use that to draw a box to delete. Only thing is that I don't know a way to script the ALT pressing, is that possible? PROCEDURE DrawToDelete; PROCEDURE DeleteThem(h :HANDLE); BEGIN DelObject(h); END; BEGIN DSelectAll; CallToolWithMode(-240,3,1); ForEachObject(DeleteThem, SEL=FALSE); END;
  3. Also see: https://www.vectorworks.net/en-US/2025 and https://app-help.vectorworks.net/2025/eng/VW2025_Guide/LandingPage/New_features.htm#h
  4. Nevermind, got it working! Thanks Raymond for the example!
  5. @MullinRJ @Pat Stanford Sorry to hack this thread I have a 2d objects with attached records. It has a field 'WaardeType' contains multiple value split with a ','. The 'waarde' field contains the corresponding values split with a ','. In the screenshot below it are two values, but this could be even more or less. Its different per object. I want a newly placed symbol to have values of the field values of the 2d object. I already gave the symbol the record '9)omgevingsplan' with field 'maximum goothoogte (m)' etc. How do I transfer the corresponding '2' to replace 'x' I think I can use your script to split one row. But how would I split one field and use that as field name to transfer the corresponding value (that also needs splitting)? It's hard to explain for me, so I made a doodle: sometimes it's only one value: The ultimate goal is to create all these symbols and use the split value to change the text Any help would be appreciated
  6. Perhaps the upcoming 3d roadways function will help for you. Probably a VW 2026 feature since it's under the development section of the roadmap, see: https://www.vectorworks.net/en-US/public-roadmap?url=roadways
  7. If you use VW 2024 you should also add a dark version of the icon. Otherwise there will be no icon if you have the dark modus selected. Perhaps this wil help?
  8. New one online: https://www.instagram.com/reel/C_MP63xJtUP/?igsh=MTc5bndpYzFhbXo2bA==
  9. Any news to the detailer tool in 2025?
  10. Hi All, After having a kid I lost the time to code for Vectorworks. But now I finally managed to finish this script that let you replace symbols (definition, rotation, scale and/or position). With a nice little menu that saves your last input. Let me know what you think! ps. If someone wants to help me make this a 'tool' with a icon that would be nice. PROCEDURE ReplaceSymbol; VAR oldH, newH :HANDLE; trackLoc :POINT3D; SymName, TempString :STRING; SymRotationNew, SymRotationOld :REAL; rPosXold, rPosYold, rPosZold :REAL; rPosXnew, rPosYnew, rPosZnew :REAL; rScaleFactorX, rScaleFactorY, rScaleFactorZ :REAL; b1, bool, bSymName, bSymRot :BOOLEAN; bSymScale, bSymPosX, bSymPosY, bSymPosZ :BOOLEAN; id, item, rScaleType :INTEGER; {******************************** Converts a boolean to a string ****************} FUNCTION Str2Boo(str :STRING) :BOOLEAN; BEGIN IF str='TRUE' THEN Str2Boo := TRUE ELSE Str2Boo := FALSE; END; {FUNCTION Str2Boo} {******************************** The ever confusing dialog handler ****************} PROCEDURE Dialog_Handler(VAR item :LONGINT; data :LONGINT); BEGIN CASE item OF SetupDialogC: BEGIN Bool := GetSavedSetting('ReplaceSymbol','SymName',TempString); SetBooleanItem(id, 4, Str2Boo(TempString)); Bool := GetSavedSetting('ReplaceSymbol','SymRot',TempString); SetBooleanItem(id, 5, Str2Boo(TempString)); Bool := GetSavedSetting('ReplaceSymbol','SymScale',TempString); SetBooleanItem(id, 6, Str2Boo(TempString)); Bool := GetSavedSetting('ReplaceSymbol','SymPosX',TempString); SetBooleanItem(id, 8, Str2Boo(TempString)); Bool := GetSavedSetting('ReplaceSymbol','SymPosY',TempString); SetBooleanItem(id, 9, Str2Boo(TempString)); Bool := GetSavedSetting('ReplaceSymbol','SymPosZ',TempString); SetBooleanItem(id, 10, Str2Boo(TempString)); SetItemText(id, 20, Symname); SetItemText(id, 21, Angle2Str(SymRotationNEW)); SetItemText(id, 22, Concat(Num2Str(1, rScaleFactorX), ' / ', Num2Str(1, rScaleFactorY), ' / ', Num2Str(1, rScaleFactorZ))); SetItemText(id, 23, Num2StrF(rPosXnew)); SetItemText(id, 24, Num2StrF(rPosYnew)); SetItemText(id, 25, Num2StrF(rPosZnew)); END; 1: { Press OK } BEGIN GetBooleanItem(id,4,bSymName); GetBooleanItem(id,5,bSymRot); GetBooleanItem(id,6,bSymScale); GetBooleanItem(id,8,bSymPosX); GetBooleanItem(id,9,bSymPosY); GetBooleanItem(id,10,bSymPosZ); END; 2: { Press CANCEL } BEGIN END; END; {Case} END; {Dialog Handler} {******************************** The slightly less confusing dialog layout ****************} PROCEDURE MakeMeADialogBox; BEGIN id:=CreateLayout('Symbol Replacer',FALSE,'OK','Cancel'); CreateCheckBox(id,4,'Definition:'); CreateCheckBox(id,5,'Rotation: '); CreateCheckBox(id,6,'Scale X/Y/Z: '); CreateSeparator(id,7, 120); CreateCheckBox(id,8,'Postion - X: '); CreateCheckBox(id,9,'Postion - Y: '); CreateCheckBox(id,10,'Postion - Z: '); CreateStaticText(id,20,'Symbolname',-1); CreateStaticText(id,21,'Rotatievalue',-1); CreateStaticText(id,22,'Symbool Scale',-1); CreateStaticText(id,23,'X-Value',-1); CreateStaticText(id,24,'Y-Value',-1); CreateStaticText(id,25,'Z-Value',-1); SetFirstLayoutItem(id,4); SetBelowItem(id,4,5,0,0); SetBelowItem(id,5,6,0,0); SetBelowItem(id,6,7,0,0); SetBelowItem(id,7,8,0,0); SetBelowItem(id,8,9,0,0); SetBelowItem(id,9,10,0,0); SetRightItem(id,4,20,0,0); SetBelowItem(id,20,21,0,-2); SetBelowItem(id,21,22,0,-2); SetRightItem(id,8,23,0,0); SetBelowItem(id,23,24,0,-2); SetBelowItem(id,24,25,0,-2); END; {******************************** Provides Callback for selecting Symbols ****************} FUNCTION CheckObjCallback(h1:HANDLE) : BOOLEAN; BEGIN If (GetTypeN(h1) = 15) then CheckObjCallback:=True; END; {//////////////////////////////// MAIN \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ } BEGIN { Pick symbol and get propertys } TrackObjectN(0,CheckObjCallback,newH,trackLoc.x,trackLoc.y,trackLoc.z); { Get parameters for dialog } SymName := GetSymName(newH); SymRotationNEW := GetSymRot(newH); GetSymLoc3D(newH, rPosXnew, rPosYnew, rPosZnew); rScaleFactorX := GetObjectVariableReal(newH, 102); { X scale } rScaleFactorY := GetObjectVariableReal(newH, 103); { Y scale } rScaleFactorZ := GetObjectVariableReal(newH, 104); { Z scale } { Start dialog } MakeMeADialogBox; item := RunLayoutDialog(id, Dialog_Handler); IF item = 1 THEN { OK } BEGIN { Save settings for later use } SetSavedSetting('ReplaceSymbol','SymName',Concat(bSymName)); SetSavedSetting('ReplaceSymbol','SymRot',Concat(bSymRot)); SetSavedSetting('ReplaceSymbol','SymScale',Concat(bSymScale)); SetSavedSetting('ReplaceSymbol','SymPosX',Concat(bSymPosX)); SetSavedSetting('ReplaceSymbol','SymPosY',Concat(bSymPosY)); SetSavedSetting('ReplaceSymbol','SymPosZ',Concat(bSymPosZ)); B1:=False; While B1 = False do BEGIN TrackObjectN(0,CheckObjCallback,oldH,trackLoc.x,trackLoc.y,trackLoc.z); IF oldH <> NIL THEN BEGIN IF bSymName THEN BEGIN { Set symbool definition } SetHDef(oldH, GetObject(SymName)); END; IF bSymRot THEN BEGIN { Set symbool rotation } GetSymLoc3D(oldH, rPosXold, rPosYold, rPosZold); SymRotationOLD := GetSymRot(oldH); HRotate(oldH,rPosXold,rPosYold,(SymRotationNew-SymRotationOld)); END; IF bSymScale THEN BEGIN { Set symbool scale } rScaleType := GetObjectVariableInt(newH, 101); SetObjectVariableInt(oldH, 101, rScaleType); rScaleFactorX := GetObjectVariableReal(newH, 102); { X scale } SetObjectVariableReal(oldH, 102, rScaleFactorX); rScaleFactorY := GetObjectVariableReal(newH, 103); { Y scale } SetObjectVariableReal(oldH, 103, rScaleFactorY); rScaleFactorZ := GetObjectVariableReal(newH, 104); { Z scale } SetObjectVariableReal(oldH, 104, rScaleFactorZ); END; IF bSymPosX THEN BEGIN { Set symbool X position } GetSymLoc3D(oldH, rPosXold, rPosYold, rPosZold); Move3DObj(oldH,rPosXnew-rPosXold,0,0); END; IF bSymPosY THEN BEGIN { Set symbool Y position } GetSymLoc3D(oldH, rPosXold, rPosYold, rPosZold); Move3DObj(oldH,0,rPosYnew-rPosYold,0); END; IF bSymPosZ THEN BEGIN { Set symbool Y position } GetSymLoc3D(oldH, rPosXold, rPosYold, rPosZold); Move3DObj(oldH,0,0,rPosZnew-rPosZold); END; ResetObject(oldH); ReDraw; END ELSE B1:=TRUE; END; END; {If user clicked OK} END; {main} RUN(ReplaceSymbol);
  11. Hi @Anthony Esau your version of the tool works well for me. Only downside is that it doesn't make multiple instances unique. Lets say I have selected two instances of 'symbol-1' and run your script only the first one becomes 'symbol-2'. Is there an option to fix this?
  12. You can try out my plugin: https://marcelplomp.gumroad.com/l/fqmyr?_gl=1*bbyizh*_ga*MTc4MTc0MTU0MC4xNzE1MzQyODQy*_ga_6LJN6D94N6*MTcxNTM0Mjg0MS4xLjEuMTcxNTM0Mjg4MC4wLjAuMA..
  13. Great to hear from you again. Looking forward to the mirror fix. Let me know if I can help with any testing.
  14. Seems like the dimension tool will get some attention as it is new at the roadmap, see: https://www.vectorworks.net/en-US/public-roadmap?url=dynamic-auto-dims Perhaps you can add your request there in the comment to get it to the right person?
×
×
  • Create New...