Jump to content

Pat Stanford

Moderator
  • Posts

    12,718
  • Joined

  • Last visited

Everything posted by Pat Stanford

  1. I don't know if anyone still finds it useful or not, but it was originally designed for architectural setting up of layers. Ground floor layer z of zero and layer height of 2500. Create next layer for second floor you get automatic , Layer Z of 2500 + Layer Height of 2500, New layer for 3rd floor automatic Layer Z of 5000 and Layer Height of 2500, etc. But even for architecture this was too limiting. Which is why Stories were added so that when things need to change you can adjust the story height and have items that are bound to the Story levels automatically adjust. Perhaps temporarily reset your layer to a level of zero and a layer height of zero, Create your new layers, then reset the heights to what you want. Best solution I have right now. Plus, check the Edit Properties After Creation box for layers so at least you will see and have the option to change the values if they are wrong. Update, the layer Z increase only occurs if you create a New layer. I you Duplicate a layer it will take the values of the layer. So create a "template" layer with layers of zero and duplicate that instead of creating a New layer. And when you do it wrong, the following one line script will reset the layer height and layer Z of the active layer to zero. SetLayerElevation(ActLayer, 0,0); Copy and paste the line above into a new blank script.
  2. Unfortunately that is the functionality. Each new layer is created at the Z elevation of the previously created layer(s) plus the Layer Height of the previous layer. So if you create a layer at 5000 with a layer height of 2500 the next layer should have a z-height of 7500. Manually editing them is the only work around I know. :-( Hopefully someone will prove me wrong.
  3. Exactly what tool and settings are you using to draw the fasteners? What fasteners? What scale are you drawing at? I have not had any problem in drawing fasteners in VW2021.
  4. Once you have one version of the class with the correct name, just delete the other classes that should use that name. You will be presented with a dialog box asking what you want to do with the objects in that class. Just reassign them to the proper class.
  5. Yes and No. Since Worksheets are dynamic, you can't just enter data into a cell. It has to have somewhere to reside that is linked to the object showing in the subrow. This place can be either a PIO field (Doors/windows/etc. have UsrFields that can work for this) or it can be a field in a custom record. If you only need a single field it will be a simple single field record. In Resource Manager create a new Record Format. For convenience in this decription I am naming the record "MyRecord". You can use any name you want. For the Record Edit window add a New Field named ID (or anything you want) and give it a type of Text. I normally use a blank default, but if you want all of your parts to have an ID you can put in anything you want. My company uses 99999 for non stock parts. In the worksheet the formula you want is: ='MyRecord'.'ID' Attach the MyRecord record to all of the parts in the Data pane of the OIP. Now anything you type into the ID column of the worksheet should be attached to the part. If you edit the ID in the OIP the worksheet will update. If you edit the ID in the worksheet the OIP will update. HTH.
  6. Great! If that works for you then we are set. If you need to be able to select on a per part basis, it would not take much to do the Record check as part of the script. Let me know if you would like or need that.
  7. Under Truss Analysis section of the VS Function Reference did you look at: HP_ConvertToHangPosTruss Analysis Vectorworks 2019 VectorScript Declaration: PROCEDURE HP_ConvertToHangPos ; Python: def vs.HP_ConvertToHangPos():    return None Description: Invkoes the Convert To Hanging Position menu command on the systems of the selected objects.
  8. No good way for the script to know that the fields should be reversed. It would have to be something your manually added to the object. The simplest solution would be to add a Record to the objects that you want width/length reversed. The script could then check and see if that record exists (or we could get fancy and use and specific Field value in the record) and swap the fields if it does. Workflow would be something like draw the object, go to the data pane and attach the record. If you decide you don't want the grain running that way, then just unattach the record. Does this sound like a solution?
  9. Now that you have it as a Menu command you should be able to add it to the contextual menu also.
  10. One of the problems that happen in so many programs that currently overload the space bar with so many functions.
  11. What no keyboard shortcut!!!! All that work and you don't even think enough to give it a shortcut. Humph! ;-)
  12. Can you get a much simpler PDF exported from VW and see if that imports for you. If it does, then we can move to the next step in figuring out how to get the big PDF to work. If it does not then we have a different problem to diagnose. Do you know anyone who is using Indesign that you could have test the PDF and see if it imports for them?
  13. If you are duplicating the Worksheet Image on the drawing, you are not duplicating the worksheet. Try duplicating the worksheet in the Resource Manager and then putting an image of that worksheet on the drawing. That should get you two separate worksheets that you can individually set the criteria for. If you are putting both images on the same Design Layer or Sheet Layer, you can just put a second database into the same worksheet as another possibility.
  14. The following is my own personal recollections and opinions. They have nothing to do with my role as a volunteer moderator on the forums. Nor do they in any way respresent opinions or policies of VW. Screen Plane exists because in many industries, specifically architecture and entertainment lighting, it is typical or required for objects to show differently in a Plan view than in a a 3D view. Think about a Door where you want a simplified version showing the swing in Plan while you want the full version showing all of the glazing, etc. in the model. These function area essential to entertainment lighting design and landscape architecture (plant) aspects of VW. Originally Vectorworks (Minicad) started with the idea of "hybrid symbols" In these any 2D objects showed in Top/Plan view and any 3D objects showed in all other views. Over the decades, this has morphed into the more complicated but more capable system that we have today. Eventually it was decided that there was a need to 2D functionality that was not fixed to the screen plane. This resulted in the addition of Layer Plane and Working Plane Object. So you can now specify what "plane" you want a 2D object (line, rectangle, dimension, circle, arc, etc.) to be on. In a hybrid object (mostly symbols and PIOs), anything that is defined as a Screen Plane object will display when you are in Top/Plan view. Objects that are in other planes will show in all other views. If you have an object that has ONLY object that are not Screen Plane (3D symbols for example), then the 3D objects will show in Top/Plan as well as in other views. Similarly, an object that has ONLY Screen Plane objects will show in 3D views as well as Top/Plan. Somewhat recently (2018/2019?) Symbols (and maybe PIOs) have been updated with the ability to use "2D Components" for the Orthogonal views. These are similar to the old show Screen Plane object when in Top/Plan, but only show the 2D in the 6 primary othogonal views and only in Hidden Line rendered viewports. This gives you more flexibility in Plan and Elevation to produce drawings that contain the appropriate (maybe more, maybe less) than the 3D model does. So back to your question. If your workflow does not require the use of the differential view for Top/Plan, it is perfectly acceptable to make all 2D objects to Layer Plane or Working plane. Just remember that you (and by you I mean pretty much every individual reading this post and/or using VW) uses it in a different fashion. Things that you might think are useless are critical to some other groups primary workflow. Please don't ask for things to be taken away just because you don't use them. These functions being present and getting VW a bigger install base helps keep the underlaying layers of code moving forward and makes it a better program for everyone. Four items that separate VW from other drawing software are the worksheet, Vectorscript/Pythonscript customization, stackable layers/classes, and the Hybrid view Top/Plan functionality. IMNSHO, without these items, VW becomes not much more than an on-screen drawing board. With these, you get a highly flexible, integrated system that can provide great value. At the expense of having a steeper learning curve. Your mileage may vary. Now back to our regularly schedule programming. Pat
  15. Before we go the next step up in hammer sizes, let's make sure this is a VW problem and not a file problem. Create a new blank file. Not from a template. Make sure the default rendering mode for 3D views is set to be OpenGL. Draw a shape and extrude it. Switch to a 3D view. Did it render? If it did, there there is a problem with your file. If it did not, there is another problem. So the 3-pound chipping hammer size solution is to quit VW, take your user folder and move it someplace (like your desktop) to make sure it can't be found by VW, and then to Restart VW. Then try the above steps. If the OpenGL rendering works then you know you have a problem in your original user folder. If you have not customized it much, then just trash the original user folder and put back new what you need. If you have customized a lot, you will have to decide how you want to move forward. Put the original folder back and start taking things out to try and find the problem. Or keep the new folder and start copying things in until you cause the problem. If none of that works, consider the 8 pound sledge, Unintall and reinstall VW.
  16. Recalculate in the contextual menu. Recalculate All Worksheet or Recalculate Active Worksheet in the Worksheet File menu if it is open for editing. There was a thread a few months ago where we created a script/tool so it could be added to the workspace and given a keyboard shortcut.
  17. Glad it is working. You have been asking for this for oh, maybe 10-15 years? Glad I finally got around to figuring out how to make VW work a little more like you would like it to. ;-)
  18. As @Benson Shaw says, what are the plane options for the objects inside the group?
  19. We are going to have to see more of your code to be able to help you. Perhaps extract just the part that makes the drop down. Use Constants or Variables but you don't need to include the code for reading the CSV.
  20. Select the group that is erroneously (Moses Supposes*) in screen plane and take a look at the OIP. It will probably tell you it is Screen Plane. Just switch it there to Layer Plane. Do you have your Plane Options (in the Info Bar) set to Screen Plane Only? *(Singing in the Rain, 1952, Gene Kelly, Donald O'Conner. 'Moses Supposed his toeses are roses, but Moses supposes erroneously.') [Get old enough and everything reminds you of something else]
  21. It sounds like your preference file may be corrupted. I recommend that you completely reset your preferences. Close all of your active drawings, but leave VW running. From Vectorworks Preferences, click the Reset button at the bottom left. This will effectively delete all of your preferences (except your serial number). Reset the preferences to your liking and exit Vectorworks Preferences. Next as an extra step, quit Vectorworks and restart. The Preference files and Workspace files only get saved when you quit successfully without crashing. If you are somehow having a crash occur before you get the preferences saved, that could be why you keep having to reset that pref.
  22. Ok. I guess it is later, but not as later as I thought would be later. ;-) Copy everything in the text block below. Edit the script, delete everything and paste in the revised script. Recalculate the worksheet. I used a different formula to calculate the Width that should work better. Procedure StockDims; {March 6, 2021} {©2021 Patrick Stanford pat@coviana.com} {Licensed under the GNU Lesser General Public License} {No Warranty Expressed of Implied. Use at your own risk.} {March 8, 2021 - Updated formual for calculation of width} {Likely to return unexpected values for objects created} {using angled polylines/polygons that are then extruded} {Return the dimesnsions of the bounding box of an urotated} {version of the object specified in the database subrow} {This is a worksheet script and will not operate if run} {directly from a script palette} {The format to run the script is:} {=RunScript('StockDims', 'DimToReturn') where DimToReturn} {can be a string of 'Length', 'Width', or 'Thick'} Var S1: String; L1, W1, H1: Real; LN, WD, TH: Real; Hd1, Hd2: Handle; R1: Real; Function RoundX(N1:Integer; Rn:Real):Real; {Rounds to the number of decimal places specified by N1} Begin RoundX:=Round(Rn*10^N1)/(10^N1); End; Begin {Get the object identified in the database subrow and the L/W/T parameter to return} {Convert the parameter to uppercase for later comparison} Hd1:=WSScript_GetObject; S1:=WSScript_GetPrmStr(0); UprString(S1); {Duplicate the identified object as a temporary object, Set the Rotation to zero,} {get the Height, Width, Lenght parameters} {Delete the temporary object} Hd2:=CreateDuplicateObject(Hd1, nil); SetRot3D(Hd2, 0, 0, 0, 0, 0, 0); Get3DInfo(Hd2, H1,W1,L1); DelObject(Hd2); {Round the values} LN:=RoundX(3, Max(Max(H1,W1),L1)); TH:=RoundX(3, Min(Min(H1,W1),L1)); WD:=RoundX(3, (H1+W1+L1-LN-TH)); {Set highest value to length, midvalue to width, smallest to thickness} {If there is an error return -999} If S1 = 'LENGTH' then R1:=LN Else If S1 = 'WIDTH' then R1:=WD Else If S1 = 'THICK' then R1:=TH Else R1:=-999; {Return the proper value to the worksheet cell} WSScript_SetResReal(R1); End; Run(StockDims);
  23. The scripts only run when the worksheet is recalculated. It will also ask (as a security measure) if you want to run the script. I usually select the Always run Scripts options. Once I did those two steps, the worksheet showed everything. But it is still not returning the right values for the back-rail-bottom. It is showing 1.25 x 70 x 70 instead of 1.25 x 2.25 x 70 that it should be showing. It could (is probably) be a script error. I will take a look later today.
  24. 30+ years of almost anything make it "easy" ;-) That's why I post a lot of the scripts that I do. So that others can at least see how I have solved a problem and hopefully be able to adjust that solution to meet their specific needs. This one had two tricky bits. First knowing that if you have a script that uses variables you have to use the Procedure / Run around the whole thing and you have to declare the variables. Second, knowing that you can use a single String variable as a criteria, but can't use a string as a piece of a criteria. Once you know those two items, the rest is just details. And as you get into scripting, remember to be stubborn. Don't let the computer beat you. It might take brute force, but you can make it do pretty much anything that you want it to do.
×
×
  • Create New...