Jump to content

Pat Stanford

  • Content Count

  • Joined

  • Last visited

Community Reputation

716 Spectacular

About Pat Stanford

  • Rank
    Vectorworks Veteran

Personal Information

  • Homepage
  • Location
    El Segundo, CA, USA

Recent Profile Visitors

4,875 profile views
  1. And to add to the complication, LOCs can be overlapping. And a smaller LOC inside the larger LOC may be counted as an object inside the LOC. The number of objects within the LOC is not an issue. The issue if the number of LOCs. What about a separate database for each LOC? They can be in contiguous rows so you only need a single label row above them all. It would take manual editing of the criteria row, but you could specify a cell (or range of cells) that would contain the LOC names so you could change them without having to change the actual criteria. Or a script to set the database formulas based on a list of location names? Lots of ways to skin the cat. =IF(((LOC<>'Zone 3')), 'Other Zone', 'Zone 3'). works for me in Column D. With the double sort I get 7 for 1a and 3 for 1b in other zones and 2 for 1b in Zone 3. Your criteria is for both lights and Light labels, so you have more than the 12 lights that are being counted.
  2. Nope, Loc is a one way criteria. You might be able to do it with columns Set the criteria to be just Lights. Enter a formula in Column C of =((LOC='Zone 1')) Enter a formula in Column D of =IF(((LOC='Zone 2')), 'Zone 2', 'Not Zone 2') Enter a formula in Column E of =Count These show you can use LOC to get the LOC an item is in, but you need to use the IF to report the name. If you are only going to have 3 zones you could reasonably use a nested If to get a single column that would display the Zone name. If you get beyond 5 or 10 then nested IFs will be a nightmare. If you Summarize first on the Instrument type in Column B. Then Summarize by Column D. You should get a count for each instrument type in Zone 2 and Not in Zone 2. Try it and ask again.
  3. If the palette is docked, hover over the thin grey bar between the drawing window and the palette. The cursor will change to a left/right double arrow. Click and drag the grey bar to make the palette narrower. If the palette is not docked, hover over the bottom right corner. The cursor will change to a upper left/lower right double arrow. Click and drag the corner of the palette to resize.
  4. Once you set the Dim Standard to be Dual Dimension, you can then choose Both/Primary/Secondary for which value to show.
  5. Post the script you have and a small sample file with about 10 of the spot elevation objects and perhaps we can make it work. A script to take the value of a text object and create 3D loci using the text as the Z-value sounds familiar, but I can't find it in my archive right now.
  6. Thanks Samuel, I am nearly always up to help anyone who wants to learn to script. I specifically tried to write this one as a tutorial so you and others can see some of what is possible. The biggest trick that I failed to point out is building the entire Criteria string into S1 before using it. Most functions don't handle criteria that only partially includes a variable very well, but if you build the entire sting into a single variable they work just fine. For many of these types of functions ForEachObject is the best way to go. That way you can write a very simple Execute function to only operate on a single object at a time. You do need to be careful about getting your Global and Local variables declared and used properly. Since H2 is declared as part of Execute, it will not have a valid value after Execute returns. Since TheCount is declared globally, it is persistent through each run of Execute. And be careful of non-serif fonts. ūüėČ. I used to use a procedure name of DoIt. Until someone read it with a SansSerif font and thought I was insulting them.
  7. Bruce I think you need to give more information about what you do what. Based on your comment, I have no idea of what you are trying to do other than to dimensions objects using different units. Why are Dual Dimensions and turning off the Primary or Secondary to only display the one you need not enough?
  8. Next time you see this, see if this script resets the DataTags. Procedure ResetDataTags; {January 22, 2020} {©2020 Patrick Stanford pat@coviana.com} {Licensed under the GNU Lesser General Public License} {Script to reset all DataTag objects in the drawing.} {Edit criteria to limit scope} {No warranty expressed or implied. Use at your own risk.} {Backup and test for suitabilty for your use.} {Here be Dragons. For external use only.} Procedure Execute(H2:Handle); Begin ResetObject(H2); End; Begin ForEachObject(Execute,((R IN ['Data Tag']))); End; Run(ResetDataTags);
  9. @DBruhnke Your statements above pretty well match with my understanding. In the initial case, since the text was being generated as part of a PIO (Title Block Border) every time the PIO was regenerated effectively the text was recreated. Which meant that since @Andy Broomell needed Adjust Flipped Text to be on, there was no way to exclude the one piece of text that he wanted flipped. That is where the 0.02¬į off of square makes a difference. I am pretty sure you understand that, but I often use the Forum as part of my external brain, so I try my best to document the Why in most of these threads as well as the how/what.
  10. I seriously doubt that anyone has gotten this into a worksheet. Since it is not related to an object, the worksheet will not be able to see any of the data. A quick search did not turn up an easy way to get the information with a script either. So a script to write the data to a worksheet is also probably out. I would love to be proven wrong. ūüėě
  11. Try this script. What shall we name it? I recommend naming it PIOWallThickness, but Bob is also nice. Let's use Bob. Create a script Palette (probably one that will never be open and will just serve as a holding place in the file for worksheet scripts) it does not matter what the palette is named. Create a new script in the palette and name it Bob. Copy the entire script from the code block below and paste it into Bob. Go to your window schedule and add a new column. Enter a formula of =RunScript(Bob). You will get a dialog box asking for permission to run scripts. Click Allow or Always Allow. I recommend Always Allow or else Bob will drive you crazy every time you recalculate the worksheet. You should now end up with the thickness of the wall that the window (or any other PIO inserted in a wall) is inserted into. It will also tell you if a PIO is not inserted in a wall. Procedure PIOWallThickness; {January 22, 2020} {©2020 Patrick Stanford pat@coviana.com} {Licensed under the GNU Lesser General Public License} {Worksheet Script to return the thickness of the wall an object is inserted into} {No warranty expressed or implied. Use at your own risk.} {Backup and test for suitabilty for your use.} {There be Dragons. Disconinue use if headache of more than 4 hours occurs.} Var H1,H2 :Handle; R1 :Real; B1 :Boolean; Begin H1:=WSScript_GetObject; {Handle to object specified by database row} H2:=GetParent(H1); {Handle to the parent of the H1 object} If GetTypeN(H2)=68 then Begin B1:=GetWallThickness(H2,R1); WSScript_SetResReal(R1); End Else WSScript_SetResStr('Not in Wall'); End; Run(PIOWallThickness);
  12. The actual permanent solution is to decide if you are using ifdwall or ifCWallStandardCase as the pSet for your file. Pick the one you want, set all the walls to that pSet and then edit the Tag to look for that record and you should be all set. Or maybe you have to have Tags set up for each of the two pSets and make sure you choose the correct tag for the pSet in use.
  13. Here is a starting point. Edit this to use your record and field names. As set now it expects a Record named Counts with fields of Rect and Circle of type Number. Also remember if the Center of a regular object is inside the LOC object it is counted. Outside and it is not counted, so you need to be careful about where your LOCs fall Fairly well commented, but ask if you need help. Without the comments, error checking and Var definitions, the code is only about 12 lines. Procedure FillCountsRecord; {January 24, 2020} {©2020 Patrick Stanford pat@coviana.com} {Licensed under the GNU Lesser General Public License} {Example script showing how to attach a record containing the Count of objects meeting a set of} {criteria inside a LOC (location) object so that the data can be accessed in a Data Tag.} {It takes the first selected object on the active layer and if it has a name it attempts} {to count the object meeting the criteria defined in CriteriaString AND are positioned in } {the LOC named by the selected object} {Edit the RecName, FieldName, and CriteriaString in the script for what you need} {Do Not inlcude a LOC criteria in CriteriaString. It is autmatically added by the script.} {This sample shows how you can duplicate the code to save the count of multiple criteria} {into multiple fields with a single execution of the script.} {If you only need a single count your can delete the second block.} {The second block also shows a more complicated criteria.} {I recommend using the Criteria Builder in the Custom Selection tool using the} {Save as Vectorscript option to build and get a copyable version of the criteria to paste} {into the CriteriaString assignment. The criteria number be between single quotes.} {No warranty expressed or implied. Use at your own risk.} {There be dragons. Backup, Backup, Backup, then Backup again.} {Test on an inconspicuous area before full application.} {Do not use if you are allergic to poorly protected code.} {Very lightly tested. Test suitability for your use.} Var H1 :Handle; LocName :String; RecName :String; FieldName :String; CriteriaString :String; S1 :String; TheCount :LongInt; Procedure Execute(H2:Handle); {This is the procedure called by the ForEachObject command} Begin TheCount:=TheCount+1; {Count the object} SetRField(H1,RecName,FieldName,Concat(TheCount)); {Store the count in the record} End; Begin H1:=FSActLayer; LocName:=GetName(H1); If ((H1<>Nil) & (LocName<>'')) then Begin RecName:='Counts'; {Enter the Record Name you want to store count in} SetRecord(H1, RecName); {This block count the objects that meet the Criteria in CriteriaString. Use the criteria Builder to} {specify the objects to count in CriteriaString. Don't specify the LOC criteria as that is determined} {by the object selected when the script is run.} TheCount:=0; {This must start at zero in each block for proper count} FieldName:='Rect'; {Enter the Field Name you want to store the count in} CriteriaString:='((T=RECT))'; {Us the Criteria builder to generate the criteria string you want and store here} {Do not include the LOC criteria as that is defined by the named object} {selected when the script is run} S1:=Concat('((LOC=', LocName, ') & ', CriteriaString, ')'); {Do not change this line, only change Criteria String} ForEachObject(Execute,S1); {************ End Block *************} {You can fill more than one field by adding a second block and changing the Field Name and Criteria} TheCount:=0; {This must start at zero in each block for proper count} FieldName:='Circle'; {Enter the Field Name you want to store the count in} CriteriaString:='((INSYMBOL & INVIEWPORT & (ST=CIRCLE) & (PF=1237)))'; {Us the Criteria builder } {to generate the criteria string you want and store here between single quotes} {Do not include the LOC criteria as that is defined by the named object} {selected when the script is run} S1:=Concat('((LOC=', LocName, ') & ', CriteriaString, ')'); {Do not change this line, only change Criteria String} ForEachObject(Execute,S1); {************ End Block *************} End Else AlrtDialog('Something went wrong. Either no object was selected or the LOC object was not named in the OIP.'); SetDSelect(H1); {Forces Refresh of OIP} SetSelect(H1); {Resets to original selection state} End; Run(FillCountsRecord);
  14. If I am reading what you did correctly, then it is the fact that you created different custom records that is the problem. You should be able to use a single record format. Then when you change the TBB Style it will keep all of the record information and just change the display. If you change to a different Record Format, you can lose data.
  15. Yeah, I see there is an example, but I can't even tell that it is really an example. Does it actually do anything? Can it be compiled and installed and actually called? This is probably the 6th time I have looked at the SDK and I have never been able to figure out enough of it to even do a "Hello World" object. GRRRRR. The docs just don't work with my brain.


7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114


© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

  • Create New...