Miguel Barrera
Member-
Posts
663 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Articles
Marionette
Store
Everything posted by Miguel Barrera
-
Default Snap and Reference Grid settings seem imperial.
Miguel Barrera replied to Bassdust's topic in General Discussion
Modify a new document with your own settings and then "Save As Template" with the name "Default.sta" which will replace the current default used when you open VW -
You can change text to a numerical with the function: value('12345') {this becomes the number 12345}
-
The license can only be checked if the computers are connected on the same network
-
A 2D path pio is the same as a polygon so you should be able to change it with the 2D reshape tool
-
This is a yearly service so depending when you sign up for it you will be billed for on the anniversary which is not necessarily during the release date. As part of the service, you get the new release when it comes out no matter when your anniversary is.
-
This is a complete list from the SDK but only a few apply to Vectorscript. Of memory, I can recall events 5, 9, 35, 41, 44, 45 to be working in VS. As for double clicking a plug-in, the default behavior is to call the edit mode which for most it does not exist and you get an error that the plug-in cannot be edited. // // Extended Events. These events can target any object type - not just parametric. // const ObjectEventID kObjOnInitXProperties = 5; // The Plug-in Object may add extended properties. const ObjectEventID kObjUnsupported6 = 6; // unsupported const ObjectEventID kObjOnSpecialEditID = 7; // The Plug-in Object called with kParametricOnMove when kHasMoveDependancy extended property set const ObjectEventID kObjUnsupported8 = 8; // unsupported const ObjectEventID kObjOnReshape = 9; // kObjOnDM_## events will be sent inside kObjOnReshape for VW 11. const ObjectEventID kObjOnDM_Select = 10; const ObjectEventID kObjOnDM_Cancel = 11; const ObjectEventID kObjOnDM_MouseDown = 12; const ObjectEventID kObjOnDM_Draw = 13; const ObjectEventID kObjOnDM_Complete = 14; const ObjectEventID kObjOnDM_GetCursor = 15; const ObjectEventID kObjOnDM_ModeEvent = 16; const ObjectEventID kObjOnDM_GetStatus = 17; const ObjectEventID kObjOnDM_CustomBarEvent = 18; const ObjectEventID kObjOnDM_BeginPauseEvent = 19; const ObjectEventID kObjOnDM_EndPauseEvent = 20; const ObjectEventID kObjOnDM_MouseMove = 21; const ObjectEventID kObjOnAttributeSelect = 26; const ObjectEventID kObjOnAttributeCancel = 27; const ObjectEventID kObjOnAttributeMouseDown = 28; const ObjectEventID kObjOnAttributeDraw = 29; const ObjectEventID kObjOnAttributeMouseMove = 29; // Meaning has changed for Vw 2011. See T00617 const ObjectEventID kObjOnAttributeComplete = 30; const ObjectEventID kObjOnAttributeGetCursor = 31; const ObjectEventID kObjOnAttributeMove2D = 32; const ObjectEventID kObjOnAttributeGetStatus = 33; const ObjectEventID kObjOnAttributeModeEvent = 34; const ObjectEventID kObjOnObjectUIButtonHit = 35; // The user has pressed a button in the Properties UI of an object const ObjectEventID kObjOnCursor_MouseDown = 36; const ObjectEventID kObjOnCursor_Complete = 37; const ObjectEventID kObjOnCursor_MouseMove = 38; const ObjectEventID kObjOnCursor_Draw = 39; const ObjectEventID kObjOnCursor_Cancel = 40; const ObjectEventID kObjOnWidgetPrep = 41; const ObjectEventID kObjOnCommand = 42; const ObjectEventID kObjOnGetToolName = 43; const ObjectEventID kObjOnAddState = 44; const ObjectEventID kObjOnContextMenuInit = 45; const ObjectEventID kObjOnContextMenuEvent = 46; const ObjectEventID kObjOnWidgetValueUpdate = 47; const ObjectEventID kObjOnEyedropperPrepareCopy = 48; // Vlado: this should be renamed const ObjectEventID kObjOnGetSpecificGeometry = 49; const ObjectEventID kObjOnCursor_CustomBarEvent = 50; const ObjectEventID kObjOnEyedropperAfterCopy = 51; // Vlado: this should be renamed
-
You do not have to change your existing printer settings. What Dieter means is to add a virtual printer that creates pdf files from any application. I use the free CutePDF Writer which shows as another printer in the list. When you are ready to export, select the pdf writer in the printer list and select the size that you need to print/export. The sheet will show in vectorworks to the full extent without any margins. Then when printing the exported pdf file, select "None" or "Actual Size" on the scaling option, which will print at the exact scale.
-
Improved scripting support
Miguel Barrera replied to Will's question in Wishlist - Feature and Content Requests
In a multiple conditional statement, you have to enclose each conditional in parenthesis as in: IF (boolean expression) & (boolean expression) THEN .... Otherwise, the compiler does not know where the conditional expression ends. You are comparing oranges to apples. Vectorscript is intended to automate and build plug-ins within VW only and it does a very good job at providing this limited functionality. For extended functions and access to the system and OS, you use the SDK and C++. Of course this gets more complicated because you then have to deal with two different systems, mac and windows. I believe this is the area where there should be more support to make it easier for creating sophisticated and dynamic applications. Just trying to set up the environment to start a project in the windows platform is a frustrating process of trial and error. -
Improved scripting support
Miguel Barrera replied to Will's question in Wishlist - Feature and Content Requests
Dieter, You proved my point when I said it takes some know how to code more efficiently and you cannot blame it entirely on the choice of language. To shorten it, you coudl also use IF Pos('_',className) > 0 THEN .... which removes the need for the IsInteger function. or copy the first two characters, convert to a number and test for greater than 0. In general, it does not matter the language but what VW offers to accomplish a task. As an example, when the DTM was introduced as a hybrid symbol, I had to make my own routine to find the elevation at a given x,y coordinate, which was over a 100 lines. Now, VS has one function that will do the same task. -
You are missing the HANDLE type in the VAR declarations
-
A string variable is defined as a character array of 255 maximum, so any where there is a Dynarray variable a string can be used. This is the same case with integers & longint which can be interchangeable as long as the longint values is not greater than the integer maximum but an integer can always be used for a longint. In the programming lingo, this is commonly called typecasting.
-
Should not be that complex since a plug-in has already been developed for standard configurations. All the math for sizing the members can be done within VW and the only difference with a dedicated package is the GUI. VS and the SDK is limited to what VW offers for user interaction through static dialogs or the OIP parameters. Truses, for their simplicity, are the first type of structures learned in an engineering program. And the theory is simply that the sum of all forces must equal 0 at every vertex/junction.
-
You would not make me happy with that concept. Symbols are like rubber stamps with only one definition. If you rotate the symbol along the z axis (x-y plane), the 2D & 3D parts should rotate by the same angle. VW is a 2D & 3D program so if you are allowed to rotate the 3D part to any angle then the 2D graphic will no longer be a representation of the 3D object as viewed from the top. The flexibility that you want can be done with plug-ins but of course you will need to script the logic behind it. An example will be a directional light, which you can rotate to any angle while keeping a 2D graphic the same.
-
This is not an open polyline. All you did is hide that side pen width but it is still a closed polyline. You will need to remove one segment for it to become open. You can tell a polygon/polyline is open if the area is zero in the OIP.
-
There is defined difference and it is simple. Polylines can have curves/lines and polygons can only have line segments. Both can be closed or open.
-
Vectorworks Help System
Miguel Barrera replied to PeterT's question in Wishlist - Feature and Content Requests
I gather this is a Mac specific problem with Adobe Air because it does not happen on Windows. When I switch between the two apps, Air is still on the same page. Air also has an index section where you can search for keywords, which is how I use it most of the time. BTW, VW's ability to produce any pdf's is limited to what Adobe offers in its Software Development Kit (SDK). -
result:= SetVPLayerVisibility(vpHdl,layHdl,0); {will make the layer visible and} result:= SetVPLayerVisibility(vpHdl,layHdl,-1); will make it invisible. Is the DLVP still referencing the external file layers or the main document layers? To get the layer handles I set up a loop starting with FLayer. curLay:= FLayer; WHILE curLay <> NIL DO BEGIN ...... ...... curLay:= NextLayer(curLay); END;
-
Improved scripting support
Miguel Barrera replied to Will's question in Wishlist - Feature and Content Requests
This can also be done in VS so it is just a matter of syntax and know how. You can practically do anything within the VW environment with VS so there is really no urgency to replace it. If you want to interface with the OS then you can use the SDK which uses C++ as the (OOP) programming language. This is the same scheme that Microstation has (VB for scripting and C for more complicated apps). The reason pascal is the programming language has to do with the origins of the program. Like the Mac, all the apps developed for it, including MiniCad (VW), were done in pascal. When the Mac and VW where converted to the C language, the SDK was developed as the modern and more complete alternate to VS. What lacks is a better programming interface, like visual dialogs, syntax checking, etc., and better documentation, specially for using the SDK on Windows which is a very complicated process just to set it up. -
Is there a simple method to "mirror" (dupe & flip) a 2D object?
Miguel Barrera replied to AEChadwick's topic in Vectorscript
Sorry but I tend to disagree with both. Objects do get a handle and are drawn as they are created. You do not see any change when the object has been created because the screen does not refresh until the code completes. I have created tools with a loop structure and a redraw function within that would get called as I moved the cursor & reported the x,y position as text on the drawing. Also while debugging, I have terminated the code before it completes and any objects that have been created to that point will be drawn. I also recall that in the beginning of VS most function calls operated on selected objects only as it has been with menu commands. Back then we relied on menu commands a lot since there was no equivalent functions. Over time, VS functions were added to operate on object handles as well. Having said that and looking at the code, the problem I see is that when an object is created, it is automatically selected. When flipHor is called all the objects are selected and consequently, all the objects get flipped. Try it with "DSelectAll" before the creation of the second group object as in: Begin DSelectAll; FirstHalf := HDuplicate(LNewObj,DoorWidth,0); SetSelect(FirstHalf); FlipHor; End; The other way of mirroring as Josh pointed out is to create the same object with the x,y coordinates in the opposite direction. -
How do I get the handle of a window in a wall?
Miguel Barrera replied to billtheia's topic in Vectorscript
I think you were on the right track but missing the code for selected windows as in the following: ForEachObject(ChangeSill, ((PON='Window') & (SEL=TRUE))); you can further restrict the criteria by including only the selected windows in a layer. ForEachObject(ChangeSill, ((L='Layer Name') & (PON='Window') & (SEL=TRUE))); -
How do I populate a parameter's choices with a dynamic list...?
Miguel Barrera replied to AEChadwick's topic in Vectorscript
While you are at it, make use of the {$DEBUG} directive so you can follow the code line by line and the timing of each event with the debugger. -
How do I populate a parameter's choices with a dynamic list...?
Miguel Barrera replied to AEChadwick's topic in Vectorscript
I use the same approach as Andrew and start with a basic structure and then build upon it. The following is a working sample for a point plug-in that draws a 1" x 1" rect. The fill hatch can be selected from a popup parameter which is populated with the code provided by Andrew PROCEDURE EventPlugin; {DEBUG} CONST kResetObjectEventID = 3; kInitObjPropEventID = 5; kButtonPressEventID = 35; kOnWidgetDefEventID = 41; kObjAddStateEventID = 44; kObjectEventHandled = -8; kObjXPropHasUIOverride = 8; kObjXHasCustomWidgtVis = 12; kObjXPropAcceptsStates = 18; kTYP_HATCHES = 66; kFLD_OBJWDT = 'Wdt'; kFLD_OBJHGT = 'Hgt'; kFLD_HTCHPOP = 'Hatch Popup'; kPRM_OBJWDT = 1; kPRM_OBJHGT = 2; kPRM_HTCHPOP = 3; VAR gResult: BOOLEAN; gObjName: STRING; gObjHdl,gRecHdl,gWallHdl: HANDLE; gVSEvent,gEvtMsg: LONGINT; PROCEDURE InsertParams; VAR result: BOOLEAN; BEGIN result:= vsoInsertAllParams; END; PROCEDURE InsertButtons; BEGIN END; PROCEDURE ProcessBtnHit; BEGIN END; PROCEDURE SetHatchPopup; VAR resType,fldrIdx: INTEGER; subFldrName,hatchName: STRING; idx,hatchResourceListID,hatchNumResources: LONGINT; BEGIN resType:= kTYP_HATCHES; fldrIdx:= 0; subFldrName:= ''; hatchResourceListID := BuildResourceList(resType,fldrIdx,subFldrName,hatchNumResources); vsoWidgetPopupClear(kPRM_HTCHPOP); vsoWidgetPopupAdd(kPRM_HTCHPOP,'None','None'); IF hatchNumResources > 0 THEN BEGIN For idx:= 1 to hatchNumResources Do Begin hatchName:= GetNameFromResourceList(hatchResourceListID,idx); vsoWidgetPopupAdd(kPRM_HTCHPOP,hatchName,hatchName); End; END; END; PROCEDURE ResetPlugin; VAR fPathIdx: LONGINT; hatchName: STRING; layScale,objWdt,objHgt: REAL; BEGIN PushAttrs; layScale:= GetLScale(ActLayer); objWdt:= layScale * PWDT; objHgt:= layScale * PHGT; hatchName:= PHATCH_POPUP; Rect(-objWdt/2, objHgt/2, objWdt/2,-objHgt/2); IF hatchName = 'None' THEN SetFPat(LNewObj,0) ELSE BEGIN fPathIdx:= Name2Index(hatchName); SetFPat(LNewObj,-fPathIdx); END; Locus(0,0); PopAttrs; END; BEGIN vsoGetEventInfo(gVSEvent,gEvtMsg); CASE gVSEvent OF kInitObjPropEventID: BEGIN SetPrefInt(590,1); gResult:= SetObjPropVS(kObjXPropAcceptsStates,TRUE); IF SetObjPropVS(kObjXPropHasUIOverride,TRUE) & SetObjPropVS(kObjXHasCustomWidgtVis,TRUE) THEN InsertParams; InsertButtons; END; kButtonPressEventID: BEGIN IF GetCustomObjectInfo(gObjName,gObjHdl,gRecHdl,gWallHdl) THEN BEGIN ProcessBtnHit; END; END; kOnWidgetDefEventID: BEGIN SetHatchPopup; vsoSetEventResult(kObjectEventHandled); END; kObjAddStateEventID: BEGIN IF GetCustomObjectInfo(gObjName,gObjHdl,gRecHdl,gWallHdl) THEN gEvtMsg:= vsoStateAddCurrent(gObjHdl,gEvtMsg); END; kResetObjectEventID: BEGIN IF GetCustomObjectInfo(gObjName,gObjHdl,gRecHdl,gWallHdl) THEN BEGIN ResetPlugin; vsoStateClear(gObjHdl); END; END; END; END; Run(EventPlugin); If nothing changes when you move or rotate the plug-in, you do not need to check "Reset on Move or Rotate". Check these only when the geometry or a parameter will change based on its location/rotation (i.e. a pile foundation height will depend on the surface elevation at the insertion point). -
After my previous HP laptop died and was replaced by HP with a cheaper Compaq as part of a lawsuit, I did some reasearch to buy a new laptop and I opted for an ASUS primarily because I did not want to buy another HP. The ASUS N53S cost $1000 and I am very happy with its performance and has no major issues so far. Windows 7 (64 bit) 15.6" HD (1920 x 1080) screen size Intel Core i7-2720QM @ 2.2GHz 6GB ram (expandable to 16GB/4 slots) I added 2-4GB for $50 = 14GB 750GB HD @ 7200 rpm Switchable graphics: Intel HD graphics or 1GB Nvidia GPU Blue-ray drive. Battery Life: 1.5 hours (full power) to 4 hours (eco setting) The battery is the only drawback but I do not use it much. When connected and fully charged, the battery gets disconnected to prevent overcharging. By now I have seen other Asus models that have much better battery performance.
-
Service Select Portal
-
To delete the symbol definitions try this code: PROCEDURE DelSymDef; {DEBUG} CONST kSYMDEF = 16; kSYMFDR = 92; kSUBSTR = 'Old Symbol'; VAR curSymDef: HANDLE; PROCEDURE SearchSymDef(curDef: HANDLE); VAR delSym: BOOLEAN; symType: INTEGER; symName: STRING; symDef1,delDef: HANDLE; BEGIN WHILE curDef <> NIL DO BEGIN symType:= GetType(curDef); IF symType = kSYMFDR THEN BEGIN symName:= GetName(curDef); symDef1:= FInFolder(curDef); SearchSymDef(symDef1); END ELSE BEGIN symName:= GetSDName(curDef); delSym:= (Pos(kSUBSTR,symName) > 0); IF delSym THEN BEGIN delDef:= curDef; curDef:= PrevSymDef(curDef); DelObject(delDef); END; END; curDef:= NextSymDef(curDef); END; END; BEGIN curSymDef:= FSymDef; SearchSymDef(curSymDef); END; Run(DelSymDef); Note that the code does not check if symbol instances are still in the drawing before deleting the definitions. I assume you will get a locus at the symbol origin and/or a corrupted file if the instances exist.