Jump to content


Vectorworks, Inc Employee
  • Posts

  • Joined

  • Last visited

Everything posted by Julian_Carr

  1. Rotated Plan View (RPV) is tricky to deal with - at least it was the last time I tried. GetPref(92) will tell you if the plan is rotated and GetPrefReal(93) will give you the angle, however both of these are read only. If they weren't, you would load the angle into a variable, set it to zero, do your copying and pasting, then restore the RPV. Something like this might work: bRPV := GetPref(92); IF bRPV THEN BEGIN VSave('_Random_'); SetView(0, 0, 0, 0, 0, 0); END; { your code } IF bRPV THEN BEGIN VRestore('_Random_'); VDelete('_Random_'); END; however using SetView() to establish Top/Plan may be fraught. Perhaps someone else will have a better idea for that.
  2. I can't seem to find how to control symbol instance scaling in VS, to achieve the same thing as the two controls in the OIP (Scaling and Factor). Any clues? Thanks.
  3. maybe try GetDefaultTextSize()? Note that this is not a document setting.
  4. I think the only way you could do this would be by hard wiring the worksheet name as a variable in the DATABASEBYSCRIPT() call. Then you could use GetObject() to obtain the handle.
  5. EditOpenGLPrefs() will allow you to set it for the document. But can't you just use Custom Modification command to edit all the viewport > background render settings in one hit?
  6. LOC doesn't work in symbol definitions so you might need to get the centre of each object in the symbol then check it is within the LOC rectangle using PtInRect().
  7. Yes it requires an event enabled PIO. Here is a code snippet: CONST kWidgetGroupMode = 81; kWidgetSeparator = 100; kWidgetGroupAutomatic = 2; VAR gb1 : BOOLEAN; gb1 := SetObjPropCharVS(kWidgetGroupMode, Chr(kWidgetGroupAutomatic)); gb1 := vsoAddWidget( 1, kWidgetSeparator, 'MY FIRST GROUP' ); gb2 := vsoAddParamWidget(2, 'ParamName1', 'Actual Param Name 1 to Display in OIP'); gb2 := vsoAddParamWidget(3, 'ParamName2', 'Actual Param Name 2 to Display in OIP'); gb2 := vsoAddParamWidget(4, 'ParamName3', 'Actual Param Name 4 to Display in OIP'); gb1 := vsoAddWidget( 5, kWidgetSeparator, 'MY SECOND GROUP' ); gb2 := vsoAddParamWidget(6, 'ParamName4', 'Actual Param Name 4 to Display in OIP'); gb2 := vsoAddParamWidget(7, 'ParamName5', 'Actual Param Name 5 to Display in OIP'); gb2 := vsoAddParamWidget(8, 'ParamName6', 'Actual Param Name 6 to Display in OIP'); Additionally you could add vsoWidgetSetIndLvl(8, x ); if you wanted to further indent one of the parameters, where X = 1 or 2 or 3 being how far it is indented.
  8. I don't know if your approach will work using DoMenu calls, however you will need to get a handle to the symbol definition. Currently your handle is to a symbol instance. Get the name of the symbol instance then use GetObject() to get the definition handle. One tip. Wall hole objects normally extend beyond the faces of the wall. If you get it working, consider scaling the wall hole object in the Y direction using: SetObjectVariableReal(h3DHole, 632, rScaleFactor);
  9. That is slightly more challenging due to what might be in the clipboard, whether the current view is Top/Plan or not, and whether the symbol is hybrid. I added a script that will work in Top/Plan with 2D objects on the clipboard, but not so well in other views. Copy To From Symbol.vwx
  10. The attached file contains two scripts that will do this – one for Cut and one for Copy. The scripts could easily be converted to menu commands and will only work if the symbol is selected then edited from the active layer by double clicking or via a keyboard shortcut. They won't work for a symbol edited from say the Resource Manager and might not work if you are within a group within a symbol. I wrote these just now while watching the footy so testing has been very limited. Use discretion until you have confidence they work as expected. Copy From Symbol Paste in Place.vwx
  11. Thanks Pat. Your idea worked for 95% of cases which is good enough. Here is the final proc I came up with: Procedure ConvertIt(h1 : HANDLE); { convert all polylines to polygons } VAR h2, h3, h4 : HANDLE; b1 : BOOLEAN; BEGIN { ConvertIt } IF GetType(h1) = 21 THEN BEGIN h3 := GetParent(h1); { h3 is handle to polyline container } h2 := ConvertToPolygon(h1, 8); { new polygon is created on active layer! } SetObjectVariableBoolean(h2, 1160, True); { make polygon screen plane } b1 := SetParent(h2, h3); { move new polygon to polyline container } HMoveBackward(h2, True); { move new polygon to back of container } h4 := FInGroup(h3); { get handle to first item in container group } REPEAT IF NextObj(h4) <> h1 THEN BEGIN HMoveForward(h2, False); { move new polygon forward to same stack position as polyline } h4 := NextObj(h4); END ELSE h4 := Nil; UNTIL (h4 = h1) | (h4 = Nil); DelObject(h1); { delete original polyline } END; END; { ConvertIt }
  12. I have a need to replace multiple polylines within the front and left symbol components, with polygons in hundreds of symbols. I can do this quite easily using ConvertToPolygon(), however I need the stacking order to be maintained so that the polygon is in the same stacking position as the polyline it replaces. The symbols have polylines at the root level of the component groups, but there are also groups that contain polylines so things get complicated. I am looking for some ideas on how I might be able to do my poly replacement while maintaining the stacking order. Wondering if there is any way to replace one handle with another to achieve this? I suspect the answer is going to be to build an array within each container (component group or group), look at the array number of the polyline, replace it, then use HMoveBackward() to put the new poly back to where the original one was. Any better ideas? Thanks!
  13. @Mark AcetoWinDoor has 4 different styles of overhead doors - some with multiple variations. It was just too much work to have them opening in 3D. With either the Door or WinDoor objects, you could cannibalise (ungroup) a unit that had bifold doors of the correct size and configuration, extract just the door geometry, rotate it 90°, convert to a symbol then replace the actual door with that. About a 5 minute exercise. This video describes the concept in WinDoor at least.
  14. Script? Procedure WSGetWallType; VAR s1 : STRING; BEGIN CASE GetWallPathType(WSScript_GetObject) OF 0: s1 := 'Straight'; 1: s1 := 'Round'; END; WSScript_SetResStr(s1); END; Run(WSGetWallType);
  15. Use GetWallPathType(): https://developer.vectorworks.net/index.php/VS:GetWallPathType
  16. I need to get a handle to a viewport, given an object within the viewport's annotation. I thought it would be easy. Using GetParent() on the object in the annotation, returns a handle to the annotation group (type = 11). Using GetParent() on that group returns a nill handle. I feel like I'm missing something?
  • Create New...