Tweet 0. Article Navigation Heading 2 Example. Heading 2 Example. Category: Office Tips. Christos Samaras. Hi, Robert, It depends on what you are trying to do. Best Regards, Christos. Add Content Block. Clear editor. Upload or insert images from URL. Using SendCommand to pass a variable. Share More sharing options Followers 0. Reply to this topic Start new topic. Recommended Posts. Type: Document. The object this method applies to.
Access: Input-only. Type: String. Its purpose is to specify the number of decimal places used by this function. As Integer defines its data type as an integer, because an integer is large enough to hold the value of decimal places, which in BricsCAD ranges from 0 to 8.
GetVariable gets the value of system variables, and it gets the value of the current drawing. In summary, this line of code gets the value of system variable LuPrec, and then stores it in iPrecision.
If starts the usual if-then decision-making construct found in all programming languages. In this case, if checks the value of vIn. VarType is the function that determines the data type of variables. It returns an integer that reports the data type. Once you know the data type, you can perform other work on it. In this case, it checks the data type of vIn. However, array types always return a value larger than in order to report the type of the array.
An array can consist of numbers, text, Booleans, and so on. In our program, the array is the coordinate triplet, such as 1,2,3. In summary, this line of code checks to see if the data type of vIn is an array.
If so, then it is an array, and processing can continue. StringFromValueFixedDecimal is a user-defined function that converts a decimal into a string, and then simulates the number of decimal points. It is listed a little later in the LastPoint.
Dvb program. It expects two arguments: a decimal number and the precision ie, the number of decimal points to display. If vIn is 3. For example, is vIn 0 is 3. In summary , this line of code converts the first element of the coordinate array into a string with a fixed number of decimal points, and then adds a comma and space.
In summary, this line of code converts the second element of the coordinate array into a string, and then concatenates it to the first element. You can start to see how the numerical array is being converted, piece by piece, to a string array. If indicates the end of the if-then statement. Can you guess the value sPt would hold in this case? The value of sPt is assigned to PointToString, where it can be accessed by any other line of code. If vIn had not been an array, the value of sPt would be 0.
Function indicates that the function has come to an end. Because this is a subroutine, the value of PointToString is now returned to the main part of the code, where it is used by this statement:. The StringToPoint routine removes quotations marks from each string to convert it to a real number. Some of the code will be familiar to you from above. Split splits the string into a one-dimensional array with the specified number of substrings.
UBound reports the size of an array. It is useful in determining whether the function is dealing with 2D coordinates a 2-element array or 3D, a three-element array. Val converts numbers in strings as a numeric value. You can download the LastInput. Dvb file from my Dropbox account. Permanent or subscription licenses that work in all languages, in all regions.
Thanks for your comment! The fastest way for you to get an answer to your question is to submit a support request. Our support team will be happy to help. Alternatively, you can visit our Forum and ask the Bricsys community. Username or Email Address. Remember Me. Rose Barfield , 1 year ago 2 34 min read. TIP To end the command correctly, ensure that the string has a space at the end, just before the closing quotation mark. End Sub signals the end of the subroutine. There are pros and cons to each method, as listed by the following table: Embedded External Storage in drawings in.
Notice the Security dialog box. If necessary, choose the Security Level tab. TIP This dialog box is necessary because of a poor decision by Microsoft programmers. This convenient feature turned into a major security problem, because it made it easy for hackers to distribute benign-looking Word and Excel files that contained malicious VBA code.
After too many people and companies suffered from having precious files erased from their computers, Microsoft finally added this dialog box to overcome the VBA exploit. If the security level is set to High, change it to Medium or Low. With VBA enabled, you can now open its programming environment. Notice the VBA programming environment.
Code is written in modules — a form that is initially blank, into which you type in the code. To start a new module, from the Insert menu, choose Module. Notice that a blank window appears, as shown below. Enter the following code into the module.
This is the same line drawing code you saw earlier. Click the Run button, which you find on the toolbar. Notice that BricsCAD draws a triangle. If the routine fails to run, check for these problems: Is security is set to High or Medium? Does the code contain spelling errors? To start a new user form, follow these steps: In the Project palette, right-click Module1.
0コメント