![](https://forum.vectorworks.net/uploads/set_resources_20/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
Miguel Barrera
Member-
Posts
663 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Articles
Marionette
Store
Everything posted by Miguel Barrera
-
Strings are delimeted by single quotes. In your formula '=DATABASE(R IN ('JAMES'))' the compiler reads it as '=DATABASE(R IN (' then JAMES which interprets as a variable and then '))' the formula should be written as '=DATABASE(R IN (''JAMES''))' where the double single quotes denotes a single quote character.
-
Have you looked at this? Custom popup page I know it does not work in VW 2008 but perhaps in later versions it does.
-
There are also keywords that can search in symbols, plugins, and viewports: INSYMBOL INOBJECT INVIEWPORT You would need to add any of these to the search criteria in your code such as: FOR i:= 1 TO kTOT_CLASS DO BEGIN curClass:= oldList; ForEachObject(ChangeName,(INSYMBOL & (C=curClass))); END;
-
BeamChek and System Recommendations Request
Miguel Barrera replied to Skia_D's topic in Architecture
I only have experience running VirtualBox on a Windows Vista computer. I run older programs like dBase and VW 11 on a Windows 2000 emulation and have not had any problems. You can install any Windows version as long as you have the installation CD. I believe Windows 2000 was the last version that did not authenticate the serial number over the internet. -
BeamChek and System Recommendations Request
Miguel Barrera replied to Skia_D's topic in Architecture
You can also use the free VirtualBox which runs on Mac OSX intel machines. -
Nested PIOs - retrieve value from child PIO
Miguel Barrera replied to Yancka's topic in Vectorscript
You cannot get values for the child pio because it has not been created yet. The mother pio needs to complete to actually create the child. -
Temporary Fill Off
Miguel Barrera replied to VincentCuclair's question in Wishlist - Feature and Content Requests
A workaround, if you want to call it that way, is to lower the opacity of the top layers. -
1. SetFPat(TextHandle,0) will set the fill to None; SetVectorFill is used to set hatches, gradients, and I think images also. 2. You need to find the text width (GetBBox) and calculate the leader start point. My suggestion would be to have the control point as the starting point for both the text and the leader, similar to the callout tool. If the control point is on the left side of the beam midpoint, the text would be right justified; if on the right side, then it would be left justified. Rather than creating the line and then moving it, it would better if you calculate the starting and ending points first and then draw the line. 3. Recursive plugins? Never tried it because I have not had a need for it but I guess it is possible. To insert plugins in VS you call: FUNCTION CreateCustomObjectN(objectName:STRING; pX,pY:REAL; rotationAngle:REAL; showPref:BOOLEAN) : HANDLE; The problem would be that you cannot edit any of the parameters for the inserted plugin directly from the OIP and only the parent plugin parameters will be visible. I would keep them separate and add another parameter that can identify it as part of a combined section.
-
For starters, it is a completely different language. C++ is based on the C language but follows the concepts of an Object Oriented Programming (OOP) environment. Every piece of a program is an object such as windows, buttons, and other interfaces with attributes and methods attached to (or encapsulated in) each object. Consequently, you cannot use the same VS (or Pascal) code in a SDK program but you can translate the code into C++ sintax and have the same functionality. Every procedure and function in VS will have an equivalent in C++ and then some. By convention, all function prototypes are listed in the header files (*.h) where you can examine what is available in the SDK. Being slow will be one criteria to convert to C++ but another will be functionality not available with VS. Among these are events and the mode bar. With events, lets say you want to highlight a valid object to click on, change to a custom cursor, or show some other information while you are hovering over or drawing an object. You could implement this behaviour during the tool click or draw event. VS automatically calls the code to show the outline of an object plugin when you click on the tool button but you do not have access to this event and cannot modify the behaviour.
-
The SDK is how NNA creates its own tools. You have access to the mode bar if needed, of course all the functions in VS, but more importantly you have access to the OS which enables you to create system wide applications. Do you need to communicate with other apps, internet, or databases? In other words, it gives you access to other computer functions outside of VW. The interface is very similar to event enabled plug-ins. You create and event loop and write the code for each type of event passed by VW. I did experiment with the VW 8 SDK and was able to build and run a simple plugin on my last Mac. The problem for me now is that it requires a Mac, which I do not have, to create the resources needed for a Windows plugin. The only reference that NNA offers is the SDK manual found in the SDK documentation
-
how do i do 3d terrain modeling in VW fundementals?
Miguel Barrera replied to kirk's topic in General Discussion
The easiest way is to use the DTM plug-in to build the 3D terrain but it is only available with Architect or Landmark. -
Here is an example; PROCEDURE RenameClassName; CONST kTOT_CLASS = 20; VAR i: INTEGER; curClass: STRING; oldList: ARRAY[1..kTOT_CLASS] OF STRING: newList: ARRAY[1..kTOT_CLASS] OF STRING: PROCEDURE ChangeName(objHdl: HANDLE); BEGIN SetClass(objHdl,newList); END; BEGIN oldList[1]:= 'old Name 1'; oldList[2]:= 'old Name 2'; ..... oldList[N]:= 'old Name N'; newList[1]:= 'new Name 1'; newList[2]:= 'new Name 2'; ..... newList[N]:= 'new Name N'; FOR i:= 1 TO kTOT_CLASS DO BEGIN curClass:= oldList; ForEachObject(ChangeName,((C=curClass))); END; END; Run(RenameClassName); I added an extra step there by assigning the name to curClass but I prefer this because ForEachObject can sometimes fail if the search string is not passed in simple terms.
-
By using LNewObj, I assume you are creating the object. Why not flip it from the start while you are drawing it. All your values for x or y will be the opposite from the original object. If you are trying to flip an existing object, what is the reason for not selecting it first?
-
Page Boundary Always on top
Miguel Barrera replied to VincentCuclair's question in Wishlist - Feature and Content Requests
You can set the pdf layer opacity to less than a 100% to view the boundary -
If your imported objects are 3D polygons, you can do all this within vectorscript in one step. All the information that you need are in the polygons. Unless NNA has changed the structure of the wall, it was composed of 3D polygons and that is how I was able to figure out the limit of the walls, thickness, height, and location of doors and windows to layout the framing.
-
What may be a problem is knowing which objects are walls. If everything that are to be imported are walls then you would be ok. Another idea would be to import the drawing and then click on each object to be converted to a wall.
-
1. PParameterName is like a constant. You can only assign its value to a variable. Why would you need something in parenthesis? 2. The control point is set initially at the origin. You can test for x = 0 & y = 0 and if true then relocate to the midpoint. 3. Yes. The main reason for having a subroutine is to use it at several points in the code where the variables passed will not always be the same. Moreover, if you plan to use the subroutine in other scripts it would be a good idea to make it self contained so you can just copy & paste or add it to a library without any modifications. 4. The delay may be caused by the code itself if certain operations regenerates the object more than once. By using the debugger you can tell how many times the code is executed.
-
Remember that PIOs are dynamic by definition and can also call other PIOs in the process to update a drawing as a whole. When you change a paramter, the PIO gets regenerated and the geometry and other parameters can change accordingly. If you already have a method to label the steel beams then it should not be a problem to implement it in the code. Since I do not know what is the practice outside the US, are the steel beams standard sizes like the ones in VW or custom designed for each job? If standard, you can have a popup list of all beams and when the type changes so does the label and shape size. When the length changes then the label and geometry change and so on. Can you post an example, including the schedule, of what you are trying to achieve?
-
The error reported is actually in line #4: xRot, yRot, zRot :REAL and it has to do with the missing semicolon ( at the end.
-
Yancka, Unless you really want to learn about 3D rotations, there is no need to do all this if you use the "extrude along path" instead. Look at the code in "Steel Beam.vso" above which draws the 3D W shape steel beam. You can enter the z value in the OIP and the steel beam will move up accordingly. All you need to do is customize the 2D part to show the label, elevation and draw the 2D beam as desired.
-
LineLength is a reserved field and it is created automatically when you create the line plugin. If you want a different name on the Object Info Palette (OIP) then use the alias field for this purpose. See the example I attached yesterday.
-
Yancka This basic script for a steel beam should get you started. It uses the extrude along path object to simplify the orientation of the extrude and will save you the headaches trying to figure out the rotations needed to show correctly.
-
Yes, it is possible and a plug-in object (PIO) means the same. For a steel beam, I would create a line plug-in and extrude the beam profile along the line. For the text, you can either have a fixed origin or add control points to move the text origin to the desired location. You can find examples in the Vectorscript support page
-
VW 2010 Door PIO causes crash when running script?
Miguel Barrera replied to David L's topic in Vectorscript
Frank, At first I thought that GetRfield may have been the problem because h2 is nil on the first pass of SetDoorNumber. But I reworked the script so that it checks for a nil handle. I used the debugger to step into each line of code and it completes without any errors. VW crashes after the script completes and it tries to reset the door PIO. PROCEDURE NumberDoorsConsecutive2; {DEBUG} VAR ?? numberStr : STRING; h,h2 : HANDLE; pX,pY : REAL; done: BOOLEAN; doorNumber,dummyVar : INTEGER; FUNCTION IsDoor(doorHdl: HANDLE): BOOLEAN; VAR lastRec: INTEGER; recHdl: HANDLE; recName: STRING; BEGIN lastRec:= NumRecords(doorHdl); recHdl:= GetRecord(doorHdl,lastRec); recName:= GetName(recHdl); IF recName = 'Door' THEN IsDoor:= TRUE ELSE IsDoor:= FALSE; END; PROCEDURE SetDoorNumber; BEGIN numberStr := Num2Str(0, doorNumber); {convert number to string} SetRField(h2,'Door','IDLabel',numberStr); ResetObject(h2); doorNumber := doorNumber + 1; {increment door number} END; BEGIN {### Ask for starting number ###} doorNumber:= IntDialog('Enter and INTEGER to start numbering:','101'); IF NOT DidCancel THEN BEGIN Message('Click in empty space to end Door numbering'); done:= FALSE; REPEAT GetPt(pX,pY); IF GetPickObjectInfo(pX,pY,h,h2,dummyVar) & (h2 <> NIL) THEN BEGIN IF IsDoor(h2) THEN SetDoorNumber; END ELSE done:= TRUE; UNTIL done; ClrMessage; END; END; RUN(NumberDoorsConsecutive2); -
How can I get more control over text size?
Miguel Barrera replied to vodsonic's topic in General Discussion
If this text is not going to change, this is the method I use to do traffic sign leyends. 1. Size the text to an approximate height. 2. Change the text to polyline. 3. If needed, adjust the horizontal spacing. 3. Scale each letter or entire word to the exact height. The scale can be set = the height desired / height in the OIP. 4. Apply a black fill to the polylines. If the text will change, then you will only be able to approximate the height by sizing the text between two parallel lines set at the desired height. The reason you cannot size it exactly is because this is a function of the operating system. VW uses system calls to draw the text which are typically declared in points.