Jump to content

Pat Stanford

Moderator
  • Posts

    12,626
  • Joined

  • Last visited

Everything posted by Pat Stanford

  1. If you want it, submit it. If it has been submitted before, your reinforcing it will make it more likely to end up higher on the list of enhancements to be done (yes, I know that some things that are highly requested are low on the list due to technical issues, but in general, the more people who ask for something, the more likely it is to happen.) Or, your description might be better than what was asked for before, or might encourage someone else to add there two cents and make it an even better.
  2. I think you are misunderstanding the difference between Database rows and Worksheet rows. A Database row shows you allow the objects in a drawing that match a certain CRITERIA. Without any filtering, each object shows as a separate subrow. You can use the Sort tiles to arrange the subrows in whatever order you need, as long as you can create a column that has the order you want. You can use the SUM tile to "collapse" multiple subrows into a single row (all objects with a width of 36 inches for example. If you have a numeric column that is the same for all instances of a collapsed subrow, you can "UnSUM" it by dragging an additional SUM tile to it. Each subrow is Linked (inextricably) to one or more objects in the drawing. You can't manually enter data into a subrow, unless there is a record/field to store that data. There is not way to show DATA (not calculations) in a subrow that is not somehow attached to/ stored with the related object. A Worksheet row is just like a row in Excel. It can access data about one or more objects in the drawing, but only ones that you have somehow manually told it about. For example, you can COUNT all of the objects in the None class, or get the AREA for all of the object with a Pen Foreground color of RED. What you can't do in a worksheet row is get the Pen Foreground Color of all the objects in the None class. You can not add a blank row into a database, because that is not what it is designed to do. If you can get by with your noted beside the object, you can create a record format with a notes field and attach that to the objects, Then you have someplace to store the note along with the object. I hope this helps. If this is not enough, let us know and I or someone else will try again.
  3. I just posted something that should work for you over in the Vectorscript Share forum. I try to post all of my scripts there to make it easier to find them in the future. https://techboard.vectorworks.net/ubbthreads.php?ubb=showflat&Number=209801Post209801
  4. In response to a post on the General Discussion, I put this script together. It will copy the data in the Dimension String of a Dimension object into a user attached Record named "DimFomat" and Field named "MyField". Change the Const values to whatever you need. The thread that started this is https://techboard.vectorworks.net/ubbthreads.php?ubb=showflat&Number=209786#Post209786 Procedure DimToRecordField; {Written in response to a request on the General Discussion Forum} {© Pat Stanford, April 2, 2015, Released into the Public Domain. No Rights Reserved} {Change the DimRecord and TheField constants to match your record and field names} {Script store the data from the DimText into a user attached record and field} Const DimRecord='DimFormat'; TheField='MyField'; Function HasRecord(H1:Handle; RecordName:String):Boolean; Var N1:Integer; Begin HasRecord:=False; For N1:= 1 to NumRecords(H1) do Begin If GetName(GetRecord(H1, N1))=DimRecord then HasRecord:=True; End; {You could add code here to SetRecord if you wanted to add the record} { to items that don't have it already attached} End; Procedure Execute(H1:Handle); Begin If HasRecord(H1,DimRecord) then SetRField(H1,DimRecord,TheField,GetDimText(H1)); End; Begin ForEachObject(Execute, (((T=DIMENSION) & (SEL=TRUE)))); End; Run(DimToRecordField);
  5. Or make the wall very low and use the Fit Walls to Object command from the AEC Menu. If you are on an older version this used to be called Fit Walls to Roofs.
  6. No offense taken. Five key items. 1. Vectorscript is based on Pascal that I learned in college, so I had a head start. 2. I started learning a lot of this back when there was a lot less to learn. 3. I am a firm believer in automating as many tasks as possible. The normal rule is as long as it will take me less than 10 times longer to automate it than to do it by hand It is more fun to script it. 4. I am a big procrastinator and scripting is usually way more fun than what I am supposed to be doing. 5. Yeah, I probably am crazy ;-) I just like to be helpful. I figure the more examples we have out there, the more people who will consider scripting and the better off the entire community will be.
  7. Rather than using the Chamfer tool, make a 3D object that is equivalent to what you need to take away and then use Subtract Solids. You can make one object to refine the chamfer and then just make three copies for the other edges and do only one Subtract. That will make it easier to do future changes.
  8. I just posted a similar script but for the circles of similar diameter at: https://techboard.vectorworks.net/ubbthreads.php?ubb=showflat&Number=209693Post209693
  9. Ok, then how about a way to do this with a tolerance. Procedure SelectSimilarDiameterCircles; {If the first selected object in the drawing is a Circle} {this script gets the Diameter of that Circle and selects all} {other Circles in the drawing that have a diameter within} {the tolerance given} {March 31.2015} {© 2015 - Pat Stanford pat@coviana.com} {Licensed under the GNU Lesser General Public License} Var H1 :Handle; ODiam, MinDiam, MaxDiam :Real; Tolerance : Real; Function Diameter(H3:Handle):Real; Var X1,Y1,X2,Y2:Real; Begin GetBBox(H3,X1,Y1,X2,Y2); Diameter:=X2-X1; End; Procedure DoIt(H2:Handle); Var TDiam:Real; Begin TDiam:=Diameter(H2); If ((TDiam > MinDiam) and (TDiam < MaxDiam)) then SetSelect(H2); End; Begin If EvalStr(FSActLayer,ST)='Circle' then Begin Tolerance:=RealDialog('Enter Percentage Tolerance for Match without % sign. 5% = 5', '5') / 100; ODiam:=Diameter(FSActLayer); MinDiam:=ODiam*(1-Tolerance); MaxDiam:=ODiam*(1+Tolerance); ForEachObject(DoIt,((ST=Circle))); End Else AlrtDialog('First Selected Object Must Be A Circle.'); End; Run(SelectSimilarDiameterCircles);
  10. One thing I woukd like to see in any new forum software is the ability to be logged in on more than one device. Now when I go to answer a post I have to log in on my phone or iPad and that logs me out from my Mac. I do have saved passwords, so it is pretty easy, but you end up two screens past the post you were trying to comment on. It might also be acceptable if after the login it returned you to the page you pushed the login button on in a logged in state. I don't think I am explaining this really well. If it doesn't make sense let me know and I will try again.
  11. If what you want is just to know that a cell has data you can use an extra column with an IF statement. IF(A2='',0,1) What this says in English is that if there is nothing in cell A2 then use a value of zero for this cell, otherwise use a value of one for this cell. You should then be able to use a Count function to get the total you are looking for.
  12. John, Do you have the symbols you are talking about set to insert into a specific class or just into the active class? If it is the active class, then the symbol definition really does not have a class. Are you talking about the class of the symbol instance or the class of objects within the symbol definition? Unfortunately, worksheets don't understand Symbol Definitions, only objects that actually exist on Layers. Are you trying to do this for EVERY symbol in the document? Or just for some subset? Tricky problem. If you just want to way to help make sure you are not forgetting anything, it might be easier to write a script that you give you a list of all the symbols that are in the file but not instanced on a layer.
  13. If you make a separate viewport for the 11x17 prints, you can "scale" the text and line weights in the Advanced Properties (button at the bottom of the OIP when you have a viewport selected.
  14. If you want to get a list of the symbols in the drawing and a count of how many you have for each type then you need to create a database row in the worksheet and set the criteria and formulas correctly. Right (Control) click on the row header and set it to be a database from the popup menu. When you get to the Criteria, set it as necessary. The primary one to set is Type IS Symbol. If you want to limit it by layer or class, add those also. You should now have as many subrows (X.1, x.2, etc) as you have symbol instances. In the database header row (just X, nothing else) enter the formulas for the data you want. You need to enter one formula to identify the symbols, I recommend =S which will give you the Symbol Name. In another column enter =Count You will now have a list of each symbol instance with a count of 1 next to it. Select the header row (or any other row) in the database. Drag the SUM tile from the top left of the worksheet into the column header (i.e. A) for the column that has the Symbol Name in it. You should now have a list of each of the types of symbol with a count of the number of instances next to it. Let me know if this needs more clarification.
  15. For the Miter, you will need to manually draw another wall and then delete the "hidden" portion you don't want. If you only have a few sections of wall at angles, you can use a Hatch or a Tile for the fill. For the walls at the angle, click the Fill Hatch (tile) Settings button in the Attributes Palette. Then in the Hatch Settings dialog box, check the Use Local Mapping and set the Rotation to what you need to get the hatch to follow the wall.
  16. For 400 shows a year, how much is this worth to you in terms of dollars or hours? You could make a PlugIn Object (PIO) that would give you popups or data entry fields in the Shape pane of the OIP instead. Depending on how complicated you want to make it and how much programming experience you have it would probably take between 5 and 50 hours of time to write. If you have more $ than time, you might contact Sam Jones (or maybe one of the other scriptures on the list will chime in) and see if he can modify something in the AutoPlot pack to do what you need. www.autoplotvw.com
  17. Title blocks are a very special object, way more than just text linked to a record. If you only have one field in your record, I would change it to two. Make the first one just text for the type of service. Make the second one an integer for the quantity. Then link both pieces of text into the symbol. You can then select the symbol in the drawing, go to the Data pane of the Object Info Palette (OIP) and change the quantity relatively easily there. If you use a worksheet with a database row to display the individual services, you can also edit the quantities there. If this does not make sense, let us know and I will try again.
  18. You can still use Saved Views to easily set/restore the different combinations of layer/class visibilities that you need.
  19. A member on the Vectorworks mail list asked about how to get the design layer names into an Excel worksheet. The following script makes a VW Worksheet of the Design Layer names and opens it. You can then copy/paste the layer names as needed. This is not a two-way worksheet. If you edit the names in the worksheet it will not change the names of the layers. Lightly tested, but use at your own risk. Backup early and often. Pat Procedure DesignLayers_to_Worksheet; {Make a worksheet listing all of the design layers in a VW file} {Lists both used and unused layers} {The worksheet is named "Layers:"with and appended date} {Sorts layers in alphabetical order prior to storing in worksheet} {March 19, 2015} {© 2015,2010, 2008, Pat Stanford pat@coviana.com} {Licensed under the GNU Lesser General Public License} var H1, H2: Handle; N1, N2: LongInt; LayerSort : Array[1..1024] of string; Begin H2:=FLayer; N2:=1; While H2 <> nil do Begin If GetObjectVariableInt(H2,154)= 1 then Begin LayerSort[N2]:=GetLName(H2); N2:= N2 + 1; End; H2:=NextLayer(H2); End; {Add Curly Braces (comment out) the next line to not sort the layers by name} SortArray(LayerSort,N2-1,0); H1:=CreateWS(Concat('Layers:',date(2,1)),N2,2); For N1:= 1 to N2-1 do SetWSCellFormula(H1,N1+1,1,N1+1,1,LayerSort[N1]); SetWSCellFormula(H1,1,1,1,1,'Layers in File'); ShowWS(H1,True); End; Run(DesignLayers_to_Worksheet);
  20. The STP seems to import fine. Are you just trying to learn to draw parts like this in VW? Or do you have a need for just this specific part? If I was going to draw this I would make a two cylinders and subtract the smaller to get the overall shape of the tube. Depending on what geometry you know I would then make a cutting piece, probably for one side of the cutter head and subtract that from each side. Create another cylinder or oblong and subtract that to get the bayonet "hooks" I am not sure what I would do for the rest of the cutout. It depends on what you know about the part. Sometimes it is easiest to make things similar to how they will really be machined. Other times it is easier to make a positive and subtract it as one piece. Let us know if you need more help.
  21. If you can draw the positive version of the hole you want cut out, then a Subtract Solid should give you the hole you are looking for. Is this part going to be made flat and then rolled? Or is it machined from a round tube/bar of some kind?
  22. Sorry Gentlemen, I don't have any magic wand for this one. PIOs are not created or reset during the running of a script. I have fought this several times and never won. When I was fighting it, I wanted to insert a PIO and convert it to a group. I could never get a handle to the object to work with because the object was not created until the script finished running and handed back all of the objects to VW to draw. I don't know how AnimationWorks does its magic. I think it might have to do with the fact that each frame is basically being written to disk individually. Maybe Julian will give us at least a hint. Regards, Pat
  23. Have you looked at the Rotate tool in the Basic Tool Palette? Select the object then Rotate tool. Click to set the center of rotation. Click again to give yourself a "lever arm" to use to rotate. move the cursor to get the rotation you want. Click a third time to finalize the rotation.
  24. If the ChildSymbol handle is Nil, you might get a run time warning, and the data would not be written to the Child Symbol because there is no handle to it. If the Parent Symbol is Nil, you would probably write bad data to the Child Symbol because the GetRField would fail when getting the Parent data. You might also get a run time warning. In this particular case, I don't think you have a problem. Since we are using ParentSymbol to get the ChildSymbol, You can't get a valid handle to the ChildSymbol unless the ParentSymbol is defined. There is always more error checking that can be done. ;-)
  25. I just took a look and I have a guess as to what is going on. My guess is that the ComponentArea function is returning a string not a number. Once it is written into a cell (stored as a string) and then read back out, the divisor code is smart enough to convert it to a number. When it is used in a formula directly, then it is still a string and is numerically a zero. Any bets?
×
×
  • Create New...