Jump to content

Miguel Barrera

Member
  • Posts

    663
  • Joined

  • Last visited

Everything posted by Miguel Barrera

  1. You need to create an event loop in order to take advantage of the recalculation by movement. Only when the object is moved, you should call the ResetObject function to regenerate the pio. If you add this function to your code above, it will go into an infinite loop and crash.
  2. Instead of saving as boolean, you could save as integers. 0 for false and 1 for true. To find the total checked you just need to add all the variables.
  3. It does work for me and I am running the same version 2010 on Win 7. I make this the last function in the reset event of the pio.
  4. Use the handle type: HMoveBackward(pioHdl: HANDLE; moveToBot: BOOLEAN);
  5. If I understand correctly, you just want to know how to subclass. Subclassing has been around a long time so maybe most take it for granted that others will know that adding a dash - will do the trick. So the answer to your question above would be: lighting-lighting circuit A
  6. Use a menu or tool script instead to present the dialog and decide whether to insert or not the plugin. You cannot delete the plugin within its own script. If there was a need to delete a PIO, it would have to be done by an external script. You can insert a PIO with: FUNCTION CreateCustomObjectN (objectName : STRING; pX,pY : REAL; rotationAngle: REAL; showPref :BOOLEAN): HANDLE;
  7. Make sure you use Move3DObj instead of HMove, which moves only along the 2D screen x,y coordinates.
  8. PROCEDURE GetBBox(h:HANDLE; VAR p1X,p1Y,p2X,p2Y:REAL); This will give you the bounding box of any object. In the case of the rect, it will be the upper-left p1x,p1y and the bottom-right corner and from there you can derive all four corners (i.e. p2x,p1y is the upper-right corner.
  9. Do not despair but I think you would get more respnses in the vs forum. There 3 ways I know that VW can read external data from: 1. ODBC, which you already mentioned, but it seems that it creates a one to one relationship, like a relational database which links a database with another by a key field. 2. The traditional but reliable text file (comma, space or tab delimited). This is how I would look up fields in a table by searching each line/row for the variable and then reading all the columns/fields in the selected row. If you have excel files, all you have to do is convert it to a csv file which is the comma delimited type or any of the other types if available. 3. Use the VectorScript XML file functions to create & read values from a file. Although it seems more functional and easier to read values, it may be slower than text files because it searches/reads one value at a time, whereas a text file searches/reads one row of values at a time.
  10. This is a document preference and consequently, you can save it as checked with the default template. Any new document with the assigned template will have the 'Save viewport cache' option checked by default. BTW, I do not use the cache option because my 3D renderings take seconds to complete and it is more important for me to keep the file small.
  11. If you already know vectorscript, why not do all the calculations that you want in the worksheet with a script? You can populate the worksheet directly without having to deal with formulas and whenever variables change, you just run the script again.
  12. I did not say you can do it with the mouse but that the same effect can be done by changing the x,y,z of each vertex in the Object Info (OIP). Besides selecting a group of vertices to edit you can also select the mesh, choose "vertex only", and cycle through each vertex to edit its x,y,z coordinate. And actually, I like this method better than using the mouse because it is more accurate. BTW, I discovered the features of the mesh when I was choosing a solid object that could be edited programmaticaly to an irregular shape or cut offs for framing members while doing the wallframer pio.
  13. You can convert it to a mesh and edit each vertex coordinate in the OIP. This feature has always been available for a mesh and this is what makes it different from a collection of 3D polygons.
  14. There is a known bug that rotates the pdf 180 degress when its opacity or the layer opacity is set to less than 100%. This only happens to me once in a while so I assume that it has to do with the way the original pdf was created. I doubt that it would be a font issue because normally it would just not print the text correctly. If the text does not look right in the exported pdf, it may be corrected by checking the option to "rasterize the text" in the export pdf dialog.
  15. Let's say you have 2 fields to sort: 1. Create another field in the array/structure for sorting. 2. Combine the fields to be sorted with Concat(field1,field2) 3. Assign this value to the added sort field. 4. Use SortArray and sort on the added field sequence number, which is the integer needed in the function. I usually set this sorting field as the first one for easier debugging. It might also be easier to use an array of a structure rather than a multiple column array because this last one can only be one type and you typically want to capture more than one type in one row of the array such as numbers,strings, and booleans.
  16. The function can only sort one column but if you add another column/field in the array/structure and place the sorting criteria there such as Concat(sortfield1,sortfield2), it will have the same effect as multiple sorting. The only implication is when the criteria has numbers and characters. The numbers will have to be converted to a string and prefixed/padded with spaces or zeros to sort in numerical order (i.e. 001,002,003,..,010,..,100). This method can also be used in worksheets as '1','10','100' are sorted before '2'.
  17. You can also hide a parameter by adding a double underline to the name such as __Parameter Name and can retrieve as P__PARAMETER_NAME and if it needs to be viewed in the PIO at any time, you can set it to visible with SetParameterVisibility(pioHandle,'__Parameter Name',TRUE);
  18. The program keeps the same unit of measurement regardless of the unit setting (inches from what I have observed but could be any other unit). It uses the unit setting for display only so when changing the unit, it converts the internal value on the fly to display the unit selected. To answer your question, everything, including dimensions, should change to the unit selected with the exception of dimensions inside PIO's and symbols not updating until being regenerated
  19. Since objects are executed in sequence, this should not be a problem if the value on the other selected objects is corrected before they execute.
  20. Try this: ClosePoly; BeginPoly; MoveTo( 0.000000000000000, 0.000000000000000); LineTo(29.341637221304214, 2.142867709577429); ArcTo( 32.123124276903425, 2.346004254109562, 3.0); LineTo(32.123124276903425, 5.134899142087672); LineTo(32.123124276903425, 6.622338911062910); ArcTo( 32.123124276903425,10.086440526200482, 2.0); LineTo(35.123124276903347, 8.354389718631834); LineTo(50.899466312727846,-0.754085602578061); LineTo(51.399466312727824, 0.111939801206404); LineTo(35.623124276903283, 9.220415122416343); ArcTo( 31.123124276903386,11.818491333769327, 3.0); LineTo(31.123124276903400, 6.622338911062958); LineTo(31.123124276903400, 5.134899142087692); ArcTo( 31.123124276903393, 3.275635883435620, 3.0); LineTo(29.268799573170593, 3.140211520414197); LineTo(-0.072837648133600, 0.997343810836742); EndPoly; I got the points by drawing the object and then exporting the file to vectorscript. This method will save you a lot of time and frustration, specially when it is simple geometry
  21. Make sure that the line inherits the class style. When you create a line in a pio, it will inherit the pio attributes as shown on the attribute palette (document attributes) when the pio is created. If you want individual objects to have a different class and attributes, you need to assign it to the object before or after it is created. I usually follow these steps to ensure class inheritance: 1. Set attributes by class (i.e. LSByClass, etc) at the beginning of the script. 2. Create object 3. Set object to the target class, as in SetClass(LNewObj,'Class name')
  22. The variable "ls" returned below should be the index that is needed for the set function ls:= GetDashStyleIndex(False,2,.005,.03); SetClLSN('PP- Projection Cone',ls); Line styles -1 to -10 are reserved for the default styles. One thing to look for is what value does "ls" returns. If it is positive, it should be changed to negative.
  23. If the current unit format is feet & inches, you can use the Num2StrF to display the document format. However, for any other format, such as inches or feet, you would need to convert (inches in your case) to the desired format (sq. ft.) Whatever the document units are, you can get the "units per inch" to convert to feet.
  24. FSActLayer = First Selected object in the Active Layer
  25. Thanks Raymond for the research. I had a resource dialog picker with the tree control since it was introduced but could not implement it in my plug-ins because the expand, collapse, and select functions were not working. I am hoping the select function is working now also.
×
×
  • Create New...