Jump to content

Miguel Barrera

Member
  • Posts

    663
  • Joined

  • Last visited

Everything posted by Miguel Barrera

  1. You can link an excel file as a database to a VW file with ODBC. You will need to setup the excel file with an ODBC driver, which is a formatting protocol that reads the header row as record fields and subsequent rows as data records. I am not sure about Macs but Windows already comes with MS drivers like excel, access, etc.
  2. It should be just a matter of converting the object from python since we can already export a file as a script. For some of my plugin objects, I did model them manually first and then export them as vectorscript to copy the object code.
  3. It will take some work to automate and fill the record fields but is it really worth the effort? when you attach the record to the extrude, the dimension data is just one tab away in the object info. Moreover, what if you decide to include other data such as material, cost, part number, etc.? you will still need to enter this info at some point in the process.
  4. I often import text files and found that comma delimited (.csv) formatted files are better to account for the empty fields. Most databases and spreadsheets have this option also for export/import so I am guessing that Filemaker would not be the exception.
  5. I entered the data manually but it is only once inside each symbol definition since the record is attached to an extrude rather than the symbol. The length, width, and thickness could be automated with a script, but other fields such as unit price would have to be entered manually (or from an external database?).
  6. line-weight, The solution was to create a record with the code, length, etc fields and attaching the record to the extrude inside each symbol. After populating the fields with data, I created the worksheet with a database row that calls for all objects with the record "Cabinet Part" attached and checking components of Symbols also. Note that columns with the SUM option will display the unique values while columns without it will display the addition of the values. shelving_sample.vwx
  7. I would say the opposite. Just about anything can be done in this program if you know how to do it. Whether you use the supplied tools, a little bit of programming or a combination of both, there is always a way to compile a material list. line-weight, can you post a sample file.
  8. I believe this could be simplified just by testing for duplicate ID. If there is more than 1 of the same ID then assign a new one to the created object. The only one regenerating would be the duplicated one because it is a new object. I have not tried this on a copy and paste operation because in my work flow, I create a new object instead but checking for duplicates should work for any new object. In my object, which is a pipe, If the ID field is empty, it will look for the next available ID and assign it to the newly created pipe. In your case, I would test on every regeneration, which would add unnecessary code some times but I do not think the delay would be noticeable.
  9. If the width is a parameter, can it be accessed with SetRField?
  10. You are missing the point that it is Apple who is forcing you to upgrade because older VW versions will not run on current Mac OS. By the way, even though I have VW 2017 through SS, I am still working with 2014 because it is more stable with less powerful graphic cards and also as a civil engineer, there is nothing in more recent versions that will benefit me. So if I did not have the subscription, I would not be forced to upgrade as you claim.
  11. I totally disagree with your statement and I believe this is caused by a misunderstanding of the application development. Every program depends on the OS to build the correct code that will run in a particular version. If the OS changes the calls to certain functions, the developer needs to change its code accordingly so the program can run without crashing. Now, it is possible to introduce IF..THEN statements to be compatible with older OS such as if version X do this but if version X+1 do that but how many versions back is the developer responsible to maintain? After a few of these IF..THEN statements, the code becomes a nightmare. I have created many vectorscript programs in a span of 20 years and a few still work because the functions calls used have not changed. However, the majority had to be updated over time because the function calls used were either deleted or changed. The same goes to changes in the OS where some programs may still run while others need to be updated. It is also possible to run previous OS with a virtual environment such as VirtualBox. I still have a dBase program from the 1990's that I run under a windows 2000 OS in VirtualBox and I also have a windows XP environment just in case I ever need to run older versions of VW. I believe that VirtualBox is available for the Mac OS too.
  12. You could format it if you convert the callout to a group but then you loose the callout functionality.
  13. Yes, you can have formulas in the database header row, which will apply to all instances. If you list a numeric value in a column, you can then use it in a formula to give you a calculated value in another column
  14. You could also use the following command to copy an object into a container object: CreateDuplicateObject( objectToDuplicate :; containerHandle :) : ; Parameters objectToDuplicate HANDLE The object to be duplicated containerHandle HANDLE The container to the newly duplicated object Duplicates the specified object and inserts the new object into the container. If container is nil, the new object will be inserted in the active container. I use this to copy objects in a symbol into a pio where I can change the look of the objects without changing the symbol definition.
  15. I start with the survey which is a collection of points. I then create 2D polylines that define the edge of the road by connecting all those points along the curb. One polyline will be the top of the curb and the other the bottom of the curb. I then run a script to convert the 2D to 3D polys, which add the elevation of the points. The resulting 3D polys are placed in the same layer as the survey points and the DTM is created with both, points and 3D polys. The sidewalk and the pavement are just a subset copy of the DTM surface that are offset in elevation by a very small value (0.001" or so higher). I created the scripts to do the drape effect because I did not have Renderworks to apply a texture so this may be easier to do nowadays with the tools available.
  16. You need to enter the roadway as part of the existing data before you build the DTM. I do this by adding 3D polygons to delineate the edge of the road. one polygon will be at the top of the curb, which usually would coincide with the sidewalk, and the other polygon at the bottom of the curb next to the pavement. In the final rendering I drape the DTM with objects that define the sidewalk and the pavement
  17. You have to keep in mind that plugins behave similar to symbols, that is, they have their own coordinate system. For example, if you want to create a line object at 30 degrees or any other angle, the code to generate this line will always be the following regardless of the angle. MoveTo(0.0); LineTo(PLINELENGTH,0); The line is drawn along the x-axis in the plugin coordinate and then transformed to the plugin origin and rotation. In the same way, if you wan to create an oval, you will need to calculate the width and height from the angle the plugin was drawn and then transform the geometry to the plugin coordinate system
  18. A linear object does not have a width or a height and that is why you get the error that they are not defined. It only has an origin, a length and rotation. The origin and rotation you get from the symbol calls and the length is the parameter name "LineLength" or the constant PLINELENGTH.
  19. The long way would be to test each segment with the LineLineIntersection procedure
  20. You could also read/write to text files as we had to do some time ago. I use CSV files to read survey files, which may contain 10K+ lines of data, and CSV tables/spreadsheets. You now have the ability to also read/write to xml files, which have a more structured format.
  21. You will find these in the VS appendix or http://developer.vectorworks.net/index.php/VS:GetFldType
  22. If you use the debugger when testing a script, you can exit at any time.
  23. This is a procedure and not a function PROCEDURE GetWSSubrowCount( worksheet :HANDLE; databaseRow :INTEGER; VAR numSubrows :INTEGER); GetWSSubrowCount(SSheet, 1,subrow);
  24. I did test this a long time ago and do not know if it works know. What I found back then was that it returns true only on the first instance of the object in the current document. If you insert any more objects of the same kind in the document, it returns false. I would expect that the function will return true every time that you insert a new object. The workaround that I use is to test for a parameter value that should not be empty. If empty, it is a new object. If it has a value, then it has gone thru the reset event already. As Raymond described above, the first iteration of the reset event draws the outline of the object but the parameters are not filled in if you have any SetRField calls. It is on the second reset event that parameters are saved.
  25. I did test this a long time ago and do not know if it works know. What I found back then was that it returns true only on the first instance of the object in the current document. If you insert any more objects of the same kind in the document, it returns false. I would expect that the function will return true every time that you insert a new object. The workaround that I use is to test for a parameter value that should not be empty. If empty, it is a new object. If it has a value, then it has gone thru the reset event already. As Raymond described above, the first iteration of the reset event draws the outline of the object but the parameters are not filled in if you have any SetRField calls. It is on the second reset event that parameters are saved.
×
×
  • Create New...