Jump to content

Pat Stanford

Moderator
  • Posts

    12,662
  • Joined

  • Last visited

Everything posted by Pat Stanford

  1. Or maybe I should actually try these things before I post them. 😞 Many of the fields in the Space object have both an editable and a static text version. The static text version is calculated based on the other entered data and is not editable in a worksheet. The numeric version is typically editable. 'Space'.'SpaceOccupancyRequirements_OccupancyNumber' Should be editable in a worksheet. 'Space'.'Occupancy' Is a static text representation and should change if you change 'Space'.'SpaceOccupancyRequirements_OccupancyNumber', but not be directly editable in the worksheet. Pat
  2. The objects inside a plant are all in different classes. That is why you are not able to see anything when you set Class to Active Only. The class of both the container (plant, plugin object, symbol, group) and the contained objects (whatever is inside) need to be set to visible to be able to see an object. If you are trying to see what classes have plants in them, set the visibility of all of the Plant-Whatever classes to be visible. Set the visibility of all the other classes to invisible. As you change the Active Class (shortcut Control Right/Left Arrow), then container objects in that class that contain objects classed as Plant-Whatever will be visible.
  3. What is your criteria for the database row? If it is Type is Space, then you do have 71 space objects in the drawing regardless of what you think you have. Remember that instances of objects in viewports show up in worksheets as objects. You probably want to change the criteria to include the Layer(s) that contain your space objects so they are not counted twice by being in a viewport. @Boh's idea of adding Layer and Class columns, and possible XCenter and YCenter as well to be able to locate the objects are good ideas also.
  4. What are your Layer and Class options? Is this object somehow in a different class and you have the class options set to Show Others? Have you tried to do a Force Select? Does it change the active layers and classes when you do so?
  5. Thanks @twk I was being lazy and hoped to not have to switch the active layer to be able to use the Show/Hide/GrayLayer options. Good catch, but I am a little surprised that the Show/Hide/Grey don't do exactly the same as the pref does under the hood.
  6. Then it must be the changing of the visibility requires project sharing access. I don't think there is anything I can do about that as the script does not specifically ask for access. It does not seem to me (with zero experience in project sharing) that you should need to own the layer to change the visibility.
  7. I have no idea why it effects project sharing. I have never used the project sharing. My guess is that it is the last line of the script Layer(GetLName(ActLayer)); {Force layer to active layer to update Nav Palette} This sets the active layer to the active layer to force a redraw of the Nav Palette. Try moving the left brace "{" to the beginning of the line to comment it out and see if that fixes the project sharing issue. As for the Message block, just delete the line that reads MEssage(DAte(2,2), LVis); This was for debugging and I missed removing it. (I have edited the script above to remove this. You could just grab it from there again instead.)
  8. Try this. Procedure Toggle; {If either layer or class specified in Consts is invisible, then sets} {both to visible. If both are visible then sets both to invsible.} {Change the LName and CName in the Const section to match your desired} {class and layer. Note code at bottom to cause proper screen and Nav} {palette updates.} {Warning: Use of this script may cause diziness. Alcohol may make this} {worse. Use care when operating a locamotive while using this script.} {If you are pregnant or considering becomeing pregnant, consult with } {CAD Manager before using this script. Self inflicted hair loss is a } {frequent side effect of learning to script. If script does not operate} {as intended, Do not pass GO, Do not collect $200. Use at your own risk.} {There be dragons. ARRRGH!} {November 12, 2018} {©2018 Patrick Stanford pat@coviana.com} {Licensed under the GNU Lesser General Public License} Const LName='1-Slab'; CName='Structural-Slab'; Var LHand : Handle; LVis, CVis : Integer; Begin LHand:=GetLayerByName(LName); LVis:=GetObjectVariableInt(LHand, 153); CVis:=GetCVis(CName); If (LVis + CVis) = 0 then {If both layer & class visible} Begin SetObjectVariableInt(LHand, 153, -1); {Layer to invisible} ResetObject(LHand); HideClass(CName); {Class to invisibile} End Else Begin SetObjectVariableInt(LHand, 153, 0); {Layer to visible} ResetObject(LHand); ShowClass(CName); {Class to visible} End; RedrawAll; {For redraw to show hide objects with changed vis} Layer(GetLName(ActLayer)); {Force layer to active layer to update Nav Palette} End; Run(Toggle);
  9. Try Value(SubString(Cell Reference Containing Text Data, Delimiter, Position)) If B3 Contains 93lbs, the cell containing =Value(Substring(B3, 'lbs', 1)) Should display as 93 formatted as whatever number type you want.
  10. Is the object just off screen after you switch the view? If you have the extrude selected before you switch view try Fit to Objects and see if it shows up. Or zoom way out until it shows up. And then back in on it. There is also an option in VW Preferences, Display Pane to Center on Objects after View Change. This might solve you problem as well.
  11. You can still do what I suggested, you just have to know the Field Name you are want. Right Click on the Database (i.e. 3, not 3.1, etc) and choose Edit Criteria. Click Cancel. In the Formula Bar you will now have a text representation of the Criteria for the database. Click into the Formula Bar and find the 'Record'.'Field' portion of the criteria and edit those values to be what you want. Hit Return to lock in the edited criteria. I THINK that as long as what you edit them to is something the criteria builder can display you can still edit the criteria the next time using the Criteria Builder dialog box. I know it is possible to create criteria that are valid for a worksheet that can't be edited with the criteria builder, but I think these are mostly cases of adding extra ANDs and ORs to the criteria. I am not saying there there should not be improvements in the Criteria Builder, just trying to offer a workaround until the functionality improves
  12. Without seeing the code, it is hard to say. If they are all similar and you want the same topdown list, you can probably edit each script to use a single include file that has just that portion of the code. Then you would only need to edit that one include file and recompile each script. If they are PIOs and are used multiple times in a drawing, you probably don't want to have the Alway Compile setting turned on, so you would need to open each in the Plugin Editor. I don't know of any want to automate that step. @JBenghiat, @MullinRJ, @Sam Jones Any of you have any suggestions?
  13. That is the way the Criteria Builder works. You can alternatively click into the formula bar and manually edit the criteria and type in whatever you need. But you will have to be exact in what you type.
  14. It would be possible to do this with a script, but would probably be slow and difficult to get right. Since you are on a Mac, I would look at getting BBEdit and using the multi-file find and replace to do the changes that way. You will probably want to restructure your scripts to use {$INCLUDE filename} structure so that most/all of the script is stored in a plain text file rather than being stored only in the VW document. If you do this you might be better off converting the scripts to Menu Item Plugin Objects so you only have to update them once rather than in every document. You will probably also need to turn on the program switch to compile the script on every run.
  15. I can't identify the setting you have to change to get this to occur, but I can verify that the ASME, BSI, and JIS dimensions standards have the property that you want. I suggest that you put some dimensions on a page Duplicate them twice, and set one set to each of the above settings. Determine which one is closest to what you want. Go to Document Preferences, Dimensions, and set the Dimension Standard to what is closest to your liking. Click the Custom button and then from the Custom Dimensions dialog box click New. This will create a new dimension with the same settings at the standard you had chosen before you hit New. Edit the standard to work as you want, then Open you template files and Import the revised dimension standard into your template(s) so it will be available when you create a new file. You probably also need to uncheck the Arrows Inside box in the OIP for the dimension if the space inside is large enough for the markers but you want them outside.
  16. The following thread has scripts to Scale individual objects and to Rotate Individual objects. Flip should not be a hard modification. You probably want to read the entire thread to figure out which version is best for your needs. Several of the posts have bugs in them, so always use the latest script that will work for your needs.
  17. In the Edit Custom Dimension Standard Dialog box, check the Dimensions Always Inside check box. Note that this my end up looking really bad if you try to dimensions a very small space with a large font and/or arrowhead.
  18. Another possibility: If you put the interactive select object into the script, you could put a DSelectAll at the beginning of the script so you will know you don't have anything selected. Select the object and then use FSObject to get a handle to that object. Probably want to check the NumSelectedObjects first to make sure that you only have a single object selected. I think this will work even if you are in a group or symbol.
  19. Let's try and phrase this a little differently. I am on a plane right now and don't have VW open, so please consider everything pseudo-code. 1. As @JBenghiat says, FSActLayer does what it says and returns the First Selected Object on the Active Layer. Being inside a group or symbol or PIO does not effect the handle returned from this function. 2. If you do If GetType(GetParent(MyObject))<>Layer, then you know that you are inside a group, symbol, PIO. You could also be in the Annotations Group or Crop Group of a viewport, or the Profile Group or Path Group of an extrude or extrude along path. Or probably inside a lot of other object types as well. You probably want to check the type of the GetParent handle to make sure you are in the type of object that you want. 3. If you already have a handle to the group, you can use FInGroup to get the first object inside the group. You will then need to use NextObj or NextSObj to step through to find the object you are interested in. If you have another way (the Name of the object perhaps) you can select it directly without having to do the NextObj step. 4. If you know you are in an object and that you have a single object selected, then the Waldo technique is probably required. Create a new object, GetLNewObject, GetParent(Last New Object), If Parent=Group, then FInGroup, NextObj until Object=Selected. Delete Waldo, Duplicate SelectedObject, SetParent to Layer. 5. Or if you are editing manually, it might be easier to just use DoMenuTextByName to do the Duplicate and see if the duplicate happens to show up as the LNewObject then you could just to SetParent on that instead. 6. Tell us more about how you are selecting the object in the group and we might be able to offer better solutions.
  20. For custom items like this @Sam Jones or @C. Andrew Dunning might be your best bet. Sam is the author of Autopilot tools for Spotlight. Very useful and inexpensive tools for lighting design. Andy is the creator of the the Staging Toolkit that at first glance seems similar to your block with visibilities idea. Hopefully my tagging them will attract their attention like sharks to chum 😉
  21. I believe that Loc only returns objects that have the center point of the object bounding box within the named object. For Round Walls it appears that it is the center point. I just did a test and can get a round wall to be counted as part of a space even when the wall itself is outside as long as the center point is in the names object. For regular walls the critical point appears to be the center point of the wall. So to answer your question, yes, it is because the center point is outside of the object.
  22. If you are typing it into a formula instead of using the criteria builder I think it would be: ((N<>'')) Those are two single quote marks to the left of the inequality. It might only need a single set of parens, but more hardly every hurt as long as they are matched.
  23. On 10/23/2018 at 11:32 AM, mgries said: =IF('Door'.'UserFld10’<>'Custom', 'Door'.'Config', 'See Door Elevation') @Pat Stanford, Any idea why this modification to your formula doesn't work? The goal is to simply write the word "Custom" into a designated user field, and then use this bit of data to overwrite any of the record fields. It's not working however. Do you know what I'm doing wrong here? My guess is that you need parentheses around the criteria. Try: =IF(('Door'.'UserFld10’<>'Custom'), 'Door'.'Config', 'See Door Elevation') If that does not work try adding a second set of parentheses. I have found that the interpereter seems to have trouble if you don't get the parens correct, but I have not found a definitive source for how it works or what the parens should be. It is probably not properly parsing the <> and so not getting a single True/False value in the criteria part of the IF statement. Not tested as I don't have VW open right now.
  24. Thanks Kevin, Check out these threads. They can do almost everything @Mark666 is asking for except the Red exclamation point to show that things are hidden.
  25. Here is the script from my last version. You can use this to create a PIO in an earlier version. Create a new PIO of type Command. It needs a single parameter named NumGroups of Type Integer and my default value of 3. Copy and Paste the script below into the Script of the command. and then add the command to your workspace. Procedure RandomGroups; {April 29, 2018} {© 2018 Patrick Stanford pat@coviana.com} {Licensed under the GNU Lesser General Public License} {No warranty expessed or implied. Use at your own risk.} {Backup your data prior to use. Do not use on your only copy of a file.} {Test thoroughly to ensure suitability to your purpose.} {Do not sit in the passenger seat while driving your Tesla while} {Running this script. May cause drowsiness. Do not operate heavy equipment} {or drive a vehical or bicycle while using this script. Use of this script} {with alcohol, prescription, or other drugs may cause unpredictable} {results and dangerous side effects. If you develop a rash of purple spots} {with cartreuse centers develops, immediately discontinue use and seek} {medical attention.} {Plugin Menu Item to assign selected objects on the active layer randomly to different groups} {The number of groups can be changed by holding hte OPTION key when the menu item is selected.} {The original intent was to provide a way to take a selection of symbols and provide} {a way to change a random selection of those objects to other symbols. This can be accomplished} {by entering each group produced and replace the contained objects. When the groups are ungrouped} {you can have a mixture of different symbols in the array. May be useful for things like} {plants, trees, people in theater seats} Type RandomStruct = Structure Hand :Handle; Rand :Real; GroupNum :Integer; End; Var A1 :Array[1..3822] of Handle; GroupArray :Array[1..11] of Handle; ObjArray :DynArray of RandomStruct; NumObjects :Integer; NumGroups :Integer; N1, N2, N3 :Integer; H1 :Handle; R1,R2 :Real; B1 :Boolean; ObjName :String; RecHand :Handle; L1 :LongInt; Begin NumGroups:=pNumGroups; {Set parameter for number of groups to a variable so it can be changed during run} {If Option key held down at menu selection then ask for number of groups} If Not AUTOKEY(L1) AND OPTION then Begin N3:=IntDialog('Enter Number of Groups (Max. 10)',Num2Str(0,NumGroups)); NumGroups:=Min(N3,10); End; {If the number of groups has changed, save that back to the parameter for the next run} If NumGroups <> pNumGroups then Begin B1:=GetPlugInInfo(ObjName, RecHand); SetRField(GetObject(ObjName), GetName(RecHand), 'NumGroups', Num2Str(0, NumGroups)); End; H1:=FSActLayer; {Get a Handle to the first selected object on the active layer} NumObjects := NumSObj(ActLayer); {Get the total number of selected objects on the active layer} Allocate ObjArray[1..NumObjects]; {Set the array size to handle the number of objects} R1:= 1/NumGroups; {Caclulate the percentage of objects to be in each group} {Store a handle to each selected object, a random number, and a group based on the random number into the object array} For N1:=1 to NumObjects do Begin ObjArray[N1].Hand:=H1; ObjArray[N1].Rand:=Random; ObjArray[N1].GroupNum:=(1+Trunc(ObjArray[N1].Rand/R1)); If ObjArray[N1].GroupNum > NumGroups then ObjArray[N1].GroupNum:=NumGroups;{Special case of random = 1} H1:=NextSObj(H1); {Move to next selected object} End; {Create groups and store the handle to each group in the group array} For N2:=1 to NumGroups do Begin BeginGroup; Locus(0,0); {Since a group can't be empty put a locus as a placeholder. Delete later} EndGroup; GroupArray[N2]:=LNewObj; End; {Iterate through groups to add objects to proper group} For N2:= 1 to NumGroups do Begin {If an object's group number matches the group array index, add that object into the group} For N1:=1 to NumObjects do Begin {SetParent is used to set the parent of the object as the group with the proper group index} If ObjArray[N1].GroupNum = N2 then B1:=SetParent(ObjArray[N1].Hand,GroupArray[N2]); End; End; {Iterate trhough groups to remove placeholder loci} For N2:= 1 to NumGroups do Begin If GetType(FInGroup(GroupArray[N2]))=17 then Begin DelObject(FinGroup(GroupArray[N2])); End; ResetBBox(GroupArray[N2]); {Reset the bounding box that was set to only the loci to put handles correctly for all contained objects} End; RedrawAll; {Force a redraw of the screen to properly display the new groups} End; Run(RandomGroups); Per @LJ TMS above, the Option Key trick (probably ALT on Windows) might not work on something other than a Mac, but that is all I have to test on. Thanks for the fix.
×
×
  • Create New...