Jump to content

michaelk

Moderator
  • Content Count

    4,771
  • Joined

  • Last visited

Community Reputation

354 Spectacular

About michaelk

  • Rank
    Vectorworks Addict

Personal Information

  • Occupation
    Lighting Design / Architectural Drafting
  • Homepage
    verysmallgroup.com
  • Location
    United States

Recent Profile Visitors

3,238 profile views
  1. That's a good question. I can't find a way to do it in a worksheet. You can call the left, right, top, and bottom bounds but that values is totally dependent on the current view. In a 3D view the values are meaningless. BUT - Data Tags can access that information. And I can't find a way to pull that information into a worksheet. Bounding Area.vwx
  2. Glad it worked. I don't use IFC data and I always get confused with roof planes because they are classified as slabs.
  3. 🤣 If I ever get an event aware tool to work I'll try it out!
  4. See if this does what you need. The trick is to 1) switch the database criteria to include only slabs or roof faces 2) change the GetIFCProperty call. If you edit the style slab or wall or roof style then click on the IFC… button you can see the values to type into the GetIFCProperty( ). The wall type, slab type, and roof type and roof type need to be assigned. By default they will all be xx-1. To edit that you can edit the wall/slab/roof style, click on the Data tab and edit the information in the Mark and Description fields. This is probably as clear as mud. Post back if you still have questions. Wall Type Schedule~.vwx
  5. What should happen if I use vstEnableMode(1,FALSE); ? I'm trying to make a parametric object not use the first mode. Object is not Event Aware. Does it need to be to use vstEnableMode?
  6. Yep. I even made unique handle variables. I started by drawing two solids and subtracting them and then exporting the script, just to make sure I was doing it right. SubtractSolid(bigObject,smallObject,subtractedObject) returns 20. (Bad input). I'm now trying to work around the subtraction. If it doesn't work I'll go back and get the subtraction code and post it.
  7. What does "Bad Input" mean as a return for a subtract solid? I'm trying to subtract solids in a parametric object. If I ungroup the parametric object and subtract the solids they work fine. But in the script they return 20. Any ideas?
  8. There's a link for Download Plug-in and Example File at the top of the page.
  9. Vectorworks can import and export .dwg directly. If it fits your workflow VW can also import IFC, Revit, Cinema 4D, PDFs, Shapefiles, .3ds, .obj, .stl, Rhino, Parasolid, and Sketchup, plus a few more and export PDF, Shapefile, .3ds, 3D PDF, Cinema 4D, .obj, .stl, Rhino, Parasolid, plus a few more. When round tripping dwg to vwx it will be useful to experiment with the import/export dwg settings to make sure you are getting back the dwg formatting you like.
  10. This sounds interesting! Not sure what that code looks like. GetEvent(?) vsoGetEventInfo(x,y)? Wow. That is not an overwhelming amount of documentation. 😁
  11. This is a really basic question: I've noticed while debugging a rectangular parametric objet that the script runs 2 or 3 times then creates the object. Should I be stopping the 2nd and 3rd running of the script? Why is it doing this? In this example I have a solid subtraction that is failing. When run in the first mode (draw the center line first) it runs but doesn't subtract. When run in the second mode (1 edge first) it loops forever. Taking out the solid subtraction fixes the loop. Running the exact same code as a script works. The solid subtraction succeeds. Is there something about solid subtractions that isn't obvious? Can't get the integer result of the solid subtraction because the program hangs.
  12. Sure. You can attach it here.
  13. So funny you should say that. I've been wondering what the difference is between vsoInsertWidget and vsoAddWidget. So I tried it out. There must be a setting somewhere I don't quite get yet. Procedure Test; {Badly Scripted by Michael Klaers.} CONST kCR = CHR(13); kObjOnInitXProperties = 5; kObjOnWidgetPrep = 41; kObjOnAddState = 44; kObjOnObjectUIButtonHit = 35; kResetEventID = 3; kObjXPropHasUIOverride = 8; kParametricEnableStateEventing = 590; kObjXPropAcceptStates = 18; ButtonID_1 = 9001; kWidgetLongInt = 1; kWidgetBoolean = 2; kWidgetReal = 3; kWidgetText = 4; kWidgetCalculation = 5; kWidgetHandle = 6; kWidgetCoordDisp = 7; kWidgetPopUp = 8; kWidgetRadio = 9; kWidgetCoordLocX = 10; kWidgetCoordLocY = 11; kWidgetButton = 12; kWidgetStaticText = 13; kWidgetStaticTextParam = 14; kWidgetDisclosure = 14; {not implemented?} kWidgetDimStdPopUp = 16; kWidgetPrecisionPopUp = 17; kWidgetClassesPopup = 18; kWidgetLayersPopup = 19; kWidgetAngleDisp = 20; kWidgetAreaDisp = 21; kWidgetVolumeDisp = 22; kWidgetSeparator = 100; kWidgetSubSelection = 101; kWidgetBoundPopup = 102; kWidgetBoundOffset = 103; kWidgetSliderWithEdit = 104; kWidgetButtonResourcePopup= 105; kWidgetBoxPosition = 106; kWidgetResourcePopup = 107; kWidgetSearchablePopup = 108; kDeadData = 0; VAR PIHan, PIRecHan, PIWallHan : HANDLE; resultStatus, result : BOOLEAN; PIName : STRING; eventMessage,theEvent : LONGINT; {---------------------------------------------------------------------} PROCEDURE InitPIO; BEGIN {This tells VW to let the object decide what goes onto the Object Info palette.} result:= SetObjPropVS(kObjXPropHasUIOverride, TRUE); result := SetObjPropVS(12, TRUE); {kObjXHasCustomWidgetVisibilities} SetPrefInt(kParametricEnableStateEventing, 1 ); result := SetObjPropVS(kObjXPropAcceptStates, TRUE); {Now we manually add the "normal" parameters...} {One way is to use this single call to add all of the existing parameters.} {result:= vsoInsertAllParams;} result := vsoInsertWidget(1,kWidgetCoordDisp,1,'',kDeadData); result := vsoInsertWidget(2,kWidgetCoordDisp,2,'',kDeadData); result := vsoInsertWidget(3,kWidgetCoordDisp,3,'',kDeadData); vsoWidgetSetIndLvl(3,1); result := vsoInsertWidget(4,kWidgetSeparator,0,'',kDeadData); result := vsoInsertWidget(5,kWidgetText,4,'',kDeadData); {Finally, we add the button.} result:= vsoAppendWidget(kWidgetButton, ButtonID_1, 'Do Something', 1); END; {---------------------------------------------------------------------} PROCEDURE WidgetPrep; BEGIN vsoSetEventResult( -8 {kObjectEventHandled} ); END; {---------------------------------------------------------------------} PROCEDURE GetStateChange; BEGIN eventMessage := vsoStateAddCurrent(PIHan, eventMessage); END; {---------------------------------------------------------------------} PROCEDURE ButtonHandler; BEGIN CASE eventMessage OF ButtonID_1: BEGIN Message('Stop Pressing That Button'); Sysbeep; Wait(3); ClrMessage; END; END; {CASE} END; {---------------------------------------------------------------------} PROCEDURE Main; BEGIN BeginXtrd(0,pExtrusion); RectangleN(0, 0, 1, 0, pWidth, pHeight); EndXtrd; {Message( 'pWidth: ',pWidth,kCR, 'pHeight: ',pHeight,kCR, 'pExtrusion: ',pExtrusion ); } END; {---------------------------------------------------------------------} BEGIN resultStatus := GetCustomObjectInfo(PIName, PIHan, PIRecHan, PIWallHan); vsoGetEventInfo(theEvent, eventMessage); CASE theEvent OF {User has single-clicked the object's icon.} kObjOnInitXProperties: InitPIO; kObjOnWidgetPrep: WidgetPrep; kObjOnAddState: GetStateChange; {User has clicked a button in the Object Info palette.} kObjOnObjectUIButtonHit: ButtonHandler; {Object reset has been called.} kResetEventID: Main; END; {Event case} END; RUN(Test);
  14. Starting the longer conversation: From experimenting with vsoAddWidget(#,kWidgetType,locName); I'm assuming that the number in the first argument is the number of the parameter in the definition. But the values aren't appearing in the OIP. Is there a different SetObjPropVS that is needed when using only vsoAddWidget? Widget type makes sense. If I use '' as the locName it inserts nothing and a colon. I thought from the function reference that if locName is '' then it uses the alternate name of the parameter? It seems like some changes in the OIP don't take effect until I open a new document. Is there a way to "reset" the OIP in the current document? Procedure Test; {Badly Scripted by Michael Klaers.} CONST kCR = CHR(13); kObjOnInitXProperties = 5; kObjOnWidgetPrep = 41; kObjOnAddState = 44; kObjOnObjectUIButtonHit = 35; kResetEventID = 3; kObjXPropHasUIOverride = 8; kParametricEnableStateEventing = 590; kObjXPropAcceptStates = 18; ButtonID_1 = 9001; kFieldLongInt = 1; kFieldBoolean = 2; kFieldReal = 3; kFieldText = 4; kFieldCalculation = 5; kFieldHandle = 6; kFieldCoordDisp = 7; {dimension} kFieldPopUp = 8; kFieldRadio = 9; kFieldCoordLocX = 10; kFieldCoordLocY = 11; kWidgetButton = 12; kWidgetStaticText = 13; kWidgetDisclosure = 14; {not implemented?} VAR PIHan, PIRecHan, PIWallHan : HANDLE; resultStatus, result : BOOLEAN; PIName : STRING; eventMessage,theEvent : LONGINT; {---------------------------------------------------------------------} PROCEDURE InitPIO; BEGIN {This tells VW to let the object decide what goes onto the Object Info palette.} result:= SetObjPropVS(kObjXPropHasUIOverride, TRUE); result := SetObjPropVS(12, TRUE); {kObjXHasCustomWidgetVisibilities} SetPrefInt(kParametricEnableStateEventing, 1 ); result := SetObjPropVS(kObjXPropAcceptStates, TRUE); {Now we manually add the "normal" parameters...} {One way is to use this single call to add all of the existing parameters.} {result:= vsoInsertAllParams;} result := vsoAddWidget(1,kFieldCoordDisp,'Blah Width'); result := vsoAddWidget(2,kFieldCoordDisp,'Blah Height'); result := vsoAddWidget(3,kFieldCoordDisp,'Blah Extrusion'); result := vsoAddWidget(1,kFieldText,''); {Finally, we add the button.} result:= vsoAppendWidget(kWidgetButton, ButtonID_1, 'Do Something', 1); END; {---------------------------------------------------------------------} PROCEDURE WidgetPrep; BEGIN vsoSetEventResult( -8 {kObjectEventHandled} ); END; {---------------------------------------------------------------------} PROCEDURE GetStateChange; BEGIN eventMessage := vsoStateAddCurrent(PIHan, eventMessage); END; {---------------------------------------------------------------------} PROCEDURE ButtonHandler; BEGIN CASE eventMessage OF ButtonID_1: BEGIN Message('Stop Pressing That Button'); Sysbeep; Wait(3); ClrMessage; END; END; {CASE} END; {---------------------------------------------------------------------} PROCEDURE Main; BEGIN BeginXtrd(0,pExtrusion); RectangleN(0, 0, 1, 0, pWidth, pHeight); EndXtrd; {Message( 'pWidth: ',pWidth,kCR, 'pHeight: ',pHeight,kCR, 'pExtrusion: ',pExtrusion ); } END; {---------------------------------------------------------------------} BEGIN resultStatus := GetCustomObjectInfo(PIName, PIHan, PIRecHan, PIWallHan); vsoGetEventInfo(theEvent, eventMessage); CASE theEvent OF {User has single-clicked the object's icon.} kObjOnInitXProperties: InitPIO; kObjOnWidgetPrep: WidgetPrep; kObjOnAddState: GetStateChange; {User has clicked a button in the Object Info palette.} kObjOnObjectUIButtonHit: ButtonHandler; {Object reset has been called.} kResetEventID: Main; END; {Event case} END; RUN(Test);
  15. Thanks, Josh. A higher number for the button id fixed it.

 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×
×
  • Create New...