Jump to content

Pat Stanford

Moderator
  • Posts

    12,705
  • Joined

  • Last visited

Everything posted by Pat Stanford

  1. I have not actually tried the script, but was the range you were pulling data FROM in a database? Or was the FROM data stored in spreadsheet cells? I ask because I have not been able to find a way to access the row that a database subcell is in. I have a request in for a function that will return the cell address that a worksheet script is running from. I have a number of scripts that could be very interesting if only I knew WHERE the script was running. Pat
  2. The way the script is written, it will only work on lines weight of EXACTLY 2, 5, 7, 10, 20 mils. If you normally work in something other than mils or other line weights, then that part of the script will need to be modified. I just copied and pasted the script from above into a VW Script and ran it on a rectangle 20 mil with a blue pen color and a Circle 10 mil with a red pen color. Both ended up being 5 mil with a dark grey/black pen color. Or did you want to fill color to change? Since we were talking about lines, I assumed it was just the pen color.
  3. First, if you are pasting code into the forum, try and use a code block. Click the <> button in the formatting bar of the post and then paste into that block. It will keep the formatting better. Try this: PROCEDURE LineWeightChange; { (c) twk based off of original code by Petri Sakkinen 2008 } CONST newWeight = 5; PROCEDURE ChangeIt (h : HANDLE); VAR oldLW : INTEGER; BEGIN oldLW := GetLW(h); IF (oldLW = 2) OR (oldLW = 5) OR (oldLW = 7) OR (oldLW = 10) OR (oldLW = 14) OR (oldLW = 20) THEN Begin SetLW(h, newWeight); SetPenFore(h, 221,0,0); End; END; BEGIN FOREACHOBJECT(ChangeIt, ((SEL=TRUE))); END; RUN(LineWeightChange); When I wrote Handle, I meant to use a handle to the object. A handle is an identifier for the program to use to find a specific object. In the case your (Petri's) script, the variable that is being used to hold the handle is h. Second, when you want to do more thing as the result of and IF/THEN or REPEAT or UNTIL conditional, you have to put all of the multiple statements between a Begin/End pair. HTH.
  4. Nice work. Does your version work in a database row or only in a worksheet row? For those not a deeply into worksheet and scripts, to make this work, you would need to make a subfolder in the [Application or Workgroup or User] folder in the Libraries/Defaults/Reports_Schedules folder and store the WSVLookup.py file in that folder. In the worksheet (as it says at the top of the script) you would use script by using a RunScript function. The 4 parameters that need to be passed are: A cell containing the value to be searched for. The range in which to search. The offset from the found location to return The type of object you are searching for: 0=String, 1=Integer, 2=real, 3=image.
  5. For a single object or for all selected objects? The commands are the same, but the wrapper needs to be different. Do you need it to check the existing and then change only objects that have a specific setting? Or just set for selected objects? If you like the script above, then the basic commands you need are: SetLW(Handle, LineWeightInMils); For the color, you would use SetPenFore(Handle, R,G,B); So you will need to get the RGB value you want. If you have it in a palette, you could use ColorIndexToRGB to get this. So just about like the above script, but with a little math to calculate mils and RGB. If you need more details, please ask again.
  6. I think Circle by 3 Points mode will get you close. Click on the 2 points you want to snap to and then hit the tab key to get into the Floating Data Bar and enter the 1500mm into the L (first) field. Then drag so the point on the red snap circle is the diameter of the circle. I think if you play with it a little bit you will see what I mean. If not please ask again.
  7. @Grethe Connerth I wrote a long post a couple of weeks ago that I think has some of the info you are looking for. Here is a short version answer to your questions: Records are a container for data that is attached to an object in the drawing. PlugIn Objects have a "Parameter Record" that contains all (most) of the data shown in the OIP and often more that is not shown. Certain complex PIOs (Stair, 2018 Drawing Border/Title Block) use a more complicated scheme and have data that is harder to access. The data in a record is stored in Fields. Fields can contain different type of data: Text; Numbers; Dimensions; Area Dimensions; etc. Normally Records (except Parameter Records) are attached to an object in the Data pane of the OIP and the field data is added there. Worksheets are a "Table Calculation Program" built into Vectorworks. They are similar to Excel or Numbers, but have more limitations and some special features. Worksheets consist of a rectangular array of "cells", arranged in Rows and Columns. Cells can contain Text, Numbers, or Formulas. Using Formulas, the data in other cells can be "referenced" using the row and column address of the cell. Cells that contain numbers (or formulas that provide a numeric result) and be used in mathematical calculations in other cells. Worksheets can have two different types of rows. Spreadsheet Rows work pretty much like other Excel like programs. You enter data and formulas manually. Some formulas will allow you to pull data from objects on the drawing by using Criteria to specify which objects to use. An example would be =Count(((L='Layer-1') & (C='My Class'))) which would count the number of objects that are on Layer 'Layer-1' and in the Class 'My Class'. The second type of row is a Database Row. In a database row, you specify the Criteria for the row and then you get a subrow for each object in the drawing that meets the criteria. Any formula that you enter into the Database Header Row will be automatically applied to every subrow. You can then Summarize subrows by the data in the formulas to get a smaller number of subrows. If we Created a Database Row using a Criteria of All Objects, we would get a subrow for every object in the drawing. If we created formulas in columns for the Layer (=L), Class (=C), and Count (=Count), then you would get a Count of 1 for each subrow. If you then Summarized but the Layer Column, you would end up with a single subrow for each Layer and the Count column would display the number of objects on that layer. Summarized objects can be nested to be more detailed. To me, Reports and Schedules are just different types of worksheets that pull the data necessary. The Create Report command is just a simplified way to generate a worksheet with a database row that uses the criteria you want and displays the data you want in the column order that you want. After using Create Report, you will probably still need to work on the formatting of the worksheet to get it to look the way you want. Schedules are a semi-standardized way to display data about objects in a drawing. It is a Worksheet/Report that has been generated and probably has the possibility to be reused in the future. Examples of standard schedules are Window and Doors schedules in architectural drawing. An Instrument List in a light plot is similar to a schedule, but often does not use that name. Since Worksheets are Resources, they can be moved between drawings using the Resource Browser. Once you create a door schedule you like, you can move it to your drawing, modify the database criteria if necessary, and you have a schedule in your drawing in a very short time. Worksheet are edited and can be used entirely in a stand alone window, including printing separately. Or, they can be set to be a "Worksheet on Drawing" so you will get an image of the worksheet as an object in the drawing. If you double click the Worksheet on Drawing image, it will open an editing window for the worksheet (and display as a box with an X in it on the drawing while the editing window is open). Close the editing window and the image on the drawing will update. I have specifically left out the detail steps on how to do any of this as I read your question to be more conceptual. I guess this is what passes for a short answer for me on work sheets these days. I hope it helps. If this is still unclear, please ask again.
  8. What are you trying to do with Vectorworks and these PDFs? Do you need to import them into VW? Or do you need some of the data from the bills in VW? Or is this not a VW related question?
  9. I just tested on one of my files and Does Not Contain and Ends With do not appear to work with symbol names. Some works arounds could be: If you only have a few symbol names that you need to exclude, just type the whole thing in and use IS as the criteria. Put those symbols in a separate class and exclude that class. If you already have records attached could you use a record value to exclude? Create a custom Record and attach it to those symbols and exclude objects with that record. Pen Color or Fill Color or Fill Pattern/Hatch?
  10. Since it is a secure PDF, there is not an easy way to do this. Some options in order of simplicity: 1. Accept that you can't and just type what you need. 2. Ask the sender to send you an unsecured version you can copy/paste from. 3. Ask the sender for the password to allow you access to the file. 4. Print/Scan/OCR (Optical Character Recognition / image to text) the document to allow you to extract the text you need. 5. Find a different program that does not respect the secure option and copy from there. 6. Do a web search for a site that will break the security on the PDF and give you an insecure version of the file back.
  11. More details on what you actually want to do would be helpful as there are multiple ways to accomplish this. Simplest is to create a new worksheet and enter a formula of =COUNT((S='Symbol-1')) where you replace 'Symbol-1' with your symbol name. This will give you the number of instances of the symbol with that name in the drawing. It will actually double count and give you the number both in the design layers plus the number in viewports, so you probably want to expand the criteria to include the layers you want also. =COUNT((S='Symbol-1')& (L='Design Layer-1')) If you get much more complicated than that, you probably want to use the Insert Criteria menu command in the Worksheet Insert menu to help you build the criteria.
  12. There are many ways to customize Vectorworks to better fit your needs. You can script in VectorScript or in PythonScript. You can create a Marionette network. You can create a custom worksheet. What you have not been able to do until now is find an in-person place to interact with others also interested in customizing VW. Michael Klaers and Pat Stanford (all around Good Dudes™ and frequent posters on the forum) would like to change that. But we need to judge if there is sufficient interest to make it worth our time to do the organizing. We have posted a short survey. 10 questions. You can answer them all in less than 2 minutes. Give us 10 minutes and you can have massive input into the event. We are truly interested in your responses, regardless of if you like the idea or not, we would like to get your feedback so we can see a broad cross section of users. The survey is posted at https://www.supersimplesurvey.com/survey/20404/conference-interest No personal information is required. We won't spam you. We just have this idea and want to see if others are with us. Thanks in advance. We hope the interest exists and we will see you at the first annual Customization Conference.
  13. When you get the Wall Framer dialog, click the Options button. At the top of the Wall Class dialog box that comes up, it probably says Default. Click there and see if there are any other settings. If there is not a setting for the class you walls are in, Click the New button and create a framing setting for the class of your walls. Change the settings as necessary and click OK. Back in the Wall Framing dialog box, choose the options and layers you want to frame and click OK. You should now get your frame. The fact that you have to specifically do settings for each class is not well described in either the dialog or the help.
  14. "green bar" effect with variable spaces between the alternating colors in databases (and a simple option in the rest of the worksheet instead of manual background color formatting) would be a good addition to making worksheets easier to read. +1
  15. I am not at all familiar with Revit, (and don't have time to check it now), so I don't know how that works. You do not have to select objects, you can use any criteria you choose (Layer, class, object type, Record present, Field value =/</>/<>/contains, pen color, fill color, etc.) It can be very powerful. I only mentioned selected because you talked about being able to deal with individual objects. Seem that the easiest way to handle a single object would be to select it and tell it to hide. Since this has been around for a very long time in VW without much change, it is probably not as smooth as the Revit version. I don't know how it compares in terms of functionality. I happen to think it is pretty cool and in some cases extremely useful.
  16. The first part of the function takes a criteria to allow you to specify exactly what you need. Explore the Insert Criteria function or the help for more details. Short answer change the T=Wall to ((L='Design Layer-2') & (T=WALL)) where you can change Design Layer-2 to any layer you choose. Ask again if you need more information.
  17. @zoomer is talking about the Custom Visibility menu item. It can be added to your workspace from the Legacy items. Custom Visibility either lets you set the visibility of items specified by criteria to either visible or invisible (I don't have VW open at the moment and can't remember is Grey is an option. I don't think it is). It also let's you save small scripts based on the criteria and settings entered. In a new file, probably the first thing I do is have it create a script call Show All. The criteria is All Objects and the operation is make visible. I also like to make scripts for Hide Selected and Hide Not Selected. These can give you a lot of control over what is visible in the drawing without a lot of work. Your criteria can get as complicated as you like, so you can be very specific in your visibility settings. Pick the Layers, classes, object types, record.field values. Whatever you need. Write back if you need more help. It won't let you override the colors of different instances though.
  18. I do not know of a way to get a database to alternately (or even worse from your sample every 3 lines) of differential background color. Would be a good thing for the wish list. Other than that, I don't see anything in a quick review of your image that can't be done with a combination of spreadsheet and database rows.
  19. In only semi-serious, one of my early mentors taught me that the way to estimate the time a project will take is to double your original thought and use the next highest unit of measure: 2 minutes -> 4 hours 4 hours -> 8 days 8 days -> 16 weeks 16 weeks -> 32 months 32 months -> 64 years 64 years -> 128 centuries ;-)
  20. Similarly, you could put the worksheet on a design layer and then use a cropped viewport with rounded corners to bring it into a sheet or another design layer.
  21. Each of the sections is a separate database. Right click in one of the database row headers (if 6, not 6.1, 6.2, etc.) and choose Edit Criteria. This will show you what criteria are currently being used in each section. You may need to look at several to figure out what you need to change. Get a couple of empty rows next to each other. Either scroll to the bottom or use the Insert menu to put them where you want the Cactus to go. Go to the bottom of the two blank rows. Right click in the Row Header and choose Database. Then enter the criteria you need. Go to each of the cells and put in the formula you need for that column. Put the Section Header in the top of the two blank rows. Ask again if you get stuck. I posted a long post a couple of days ago about databases. You might want to read that also.
  22. There are several different ways to put in "structural shapes" exactly which tool and which options are you using to create these objects. It is likely the the are set to us a Pattern rather than a Hatch. Patterns are always to screen scale and alignment.
  23. That looks like a resource name or a symbol name, not the name that you typed into the bottom of the OIP. If it is a symbol AND it is placed in the drawing (anywhere), Try: =IMAGE(((S='Symbol-1'))) And make sure you don't have any extra spaces before the equals or after the last paren. Obviously, change the Symbol-1 to the correct symbol name. Sorry if I am being overly explicit.
  24. Michael is right, the only way to get them to display something other than zero is to use some form of IF which then eliminates your editabilty. Is it illogical? Maybe, but it is the way it works. You have asked for the value of a number field in a record that is not attached to the object. Since it is a number the value that indicated that nothing is there happens to be zero. Would different functionality be better, probably. Is it going to happen soon, probably not. Perhaps you need two versions of your worksheet. One with the IF functions to mask the missing data and one without the IF functions to be editable.
  25. I have not used them, but look at: GetStoryLayerTemplateName This will get you the name of the first story in the template. Combined with GetObject might get you a handle to the first story in the file. If that does not do what you want then perhaps GetStory of Layer might get you something your can work with. Then there is GetStoryAbove and GetStoryBelow to move through the list.
×
×
  • Create New...