Jump to content

Pat Stanford

Moderator
  • Content Count

    5,699
  • Joined

  • Last visited

Community Reputation

713 Spectacular

About Pat Stanford

  • Rank
    Vectorworks Veteran

Personal Information

  • Homepage
    vectortasks.com
  • Location
    El Segundo, CA, USA

Recent Profile Visitors

4,871 profile views
  1. 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);
  2. @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.
  3. 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. 😞
  4. 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);
  5. 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.
  6. 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);
  7. 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.
  8. 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.
  9. How are you doing the title blocks? Are you using the Title Block Border object? Or are you using home made symbols and text blocks? I you are using the TBB and the different title block are set up using the same basic field names and record format, you should be able to Replace the TBB Style and keep the data. Or perhaps you just need to edit the TBB Style settings to let it work on different sheet sizes and let you adjust the Title Block scaling factor to make it the size you want.
  10. @Amorphous - JulianI would like to spend a little more time to check this and clean it up before I share with anyone. Thanks for the offer. Send me a project and I will run it and send you the output. Yes, a different sort for this file would work, but only because the ceiling height is higher than the default. In the case where it is lower, then the wrong value will be returned. I think you can add Layers to Levels from the Layer Pane of the Organization Palette. Select the Layer, click the Edit button and then set the Story to associate with from the Edit Design Layers dialog box.
  11. Right Click on the Symbols in the Resource Manager and choose Edit Symbol Options... Make sure the Convert to Plug-in Object (if it is a single object in the symbol) or Convert to Group (if there are multiple objects in the symbol) is checked. Then when you bring a "symbol" with that option into the drawing it will be automatically converted into a PIO or a Group. BUT, it will no longer be a symbol and if you change it, it will only change that instance and not every instance in the drawing. For items already in the drawing, you can use the Modify:Convert to Plug-in Object or Convert to Group menu commands to do the same thing.
  12. The only "easy" way to do this would be to turn on the Use Wall Depth for the Jambs and then report the Jamb Depth. IF this is for just your use, a worksheet script could be written that would find the parent of each window (the wall) and return the width. The problem is the script will have to live in every file OR will have to be installed on every VW installation that will ever recalculate the worksheet. Alternatively, you could use a simple script to store the value of the wall thickness into one of the User Fields (or a custom record) and then use the standard worksheet functions to report it. But if you change a wall thickness and forget to run the script, then the data will be wrong. To implement for an entire office is probably more trouble than it is worth. To implement for yourself might be reasonable. Let me know if you want help in making either of these options happen.
  13. Unless you really need to have it be that exact circle and size, I would work it the other way and do the basic math of what the perimeter would by of a polygon with X sides equal to the base of your triangle and then figure the rotation angle to get 360° with that number of faces of a polygon (360/X). Or start with a regular polygon with the number of sides you want and then make a triangle that matches the length of one face. Trying to get a solution where the length of an arbitrary number of equal chords that will match the circumference of a circle won't be easy to do either the math or graphically. To actually do the duplicates you can do either Duplicate Array with the Rotate Duplicates and Use Duplication Angle options set or use the Duplicate Along Path with the Tangent to Path and Keep Original Orientation options on and the Center Object on Path option off. Or if you don't want to have to do math and you are going to do an Add Surface at the end to get a single polygon anyway. Make a regular polygon with the appropriate number of sides. Draw an overlapping circle with a radius equal to the points of the triangles and Send to Back. With the Snap to Object and Snap to Angle snaps on, use the Reshape Polygon tool in the Add Point mode to drag the center point of each face out to the circle. Use the Perpendicular and Object snaps to get it right. For the ~30-60 sides you need it should not take more than about 2 minutes.
  14. Do any of you fine people have an example of a simple Vectorscript Function Extension implemented in the SDK that I could learn from? Thanks, Pat
  15. Actually to be fair I should credit @JBenghiat He found the 0.02° trick in Label Legends a while ago. I had tried 0.01° and it did not work. I just had to do the right search in my archive. 😉

 

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...