Jump to content

Pat Stanford

Moderator
  • Content Count

    5,168
  • Joined

  • Last visited

Community Reputation

479 Spectacular

About Pat Stanford

  • Rank
    Vectorworks Veteran

Personal Information

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

Recent Profile Visitors

3,984 profile views
  1. Pat Stanford

    Learning Vector Work.

    I don't have time to do a full in depth class on how VW works, but you are correct the simple version does not work inside viewport annotations. If you need it to work anywhere, you will need to do more checking on the object to figure out where it is. The basic way to do this is to GetTypeN(GetParent(Handle_to_Object)); If the type of the parent is a layer then you handle it one way. If the parent is a group or symbol you handle it another way. You have to do more explicit checking to see if it is the annotation group of a viewport. The best suggestion I can offer right now is to search in the Vectorscript and Archive-Resource Share-Vectorscript forums for Viewport Annotations. I know I have posted on this before. Sorry I don't have time to help more right now or next week. I will try to answer specific questions if I can.
  2. Pat Stanford

    Learning Vector Work.

    You only need to use 22 if you want a box around the "secondary" dimension. VW lets you do dual dimensioning (say metric & imperial at the same time). 5 will box the Primary dimension, 22 will box the secondary dimension. You have to run two commands to box both. You can try RedrawAll in place of the ResetObject. If you are only doing a single dimension with the script then ResetObject is probably better. If you are looping through a lot of objects RedrawAll is probably better as it will only have to update the screen once instead of after every dimension. In that case you would use it near the end of your script after you have changed all of the dimensions. The SetDimText command will convert any line into a dimension. You can certainly create an auto dimension tool, but my guess is that by the time you get it worked out and all of the special cases and error checking needed to make it work no matter what kind of an object you throw at it, you will spend more time than you would spend dimensioning manually over the next decade. Check the function reference for routines returning the vertices of polygons and remember that rectangles are not polygons and have to be handled as a special case. What would you do when someone passes a curve or a circle instead of a box? What about when text, or a symbol, or some other kind of object. All cases that a general purpose script will have to handle, even if only by explicitly not handling them. Good luck if you choose to proceed.
  3. Pat Stanford

    Learning Vector Work.

    I don't know of a way to set the Box Text option as the default. The two lines below will set the Box Text option for the first selected object on the active layer. You could wrap this in a repeat loop of use ForEachObject to handle every dimension in the drawing. If you need to box the secondary dimension instead of the primary, switch the 5 to 22 in the SetObjectVariableBoolean line. SetObjectVariableBoolean(FSActLayer,5,True); ResetObject(FSActLayer); The Reset is required to get the box to actual show. If you are doing a bunch of objects in the script you can probably do a RedrawAll instead and it will only have to update the screen once and might make the script faster for many dimensions. Ask again if you need more help.
  4. Pat Stanford

    Learning Vector Work.

    I think you may need to give us a better description of what you want to do. The simplest way to do what I am reading in your question is to put the text into the Note field. The Vectorscript command to do that is SetDimNote(Handle_to_Dim, 'Note Text); If you really want a more complicated text box to be associated with a dimension then you probably need to create a custom object (PlugIn Object) that consists of the dimension and a separate text box.
  5. Pat Stanford

    Create New Document

    The script equivalent to clicking in the middle would be MoveTo(0,0); Another option would be to Group the objects, get a handle to the group, get the center of the group, HMove the group by the negative of the center (i.e. back to 0,0), Change the layer, and ungroup. The ones that are not centered probably have some object way out in space that you need to investigate and either move in closer or delete.
  6. Pat Stanford

    Create New Document

    If you are on a Mac you should be able to use an Applescript to open a new file from the template and then run the script to do the dwg import. Vectorscript/Pythonscript are very document centric, so there is really no way to have them open a different VWX file. It seems like you should be able to script importing of layers and classes like you can from the Organization Palette, but I can't find the right calls in the Function Reference. @JBenghiat Do you have a way to script importing layers and classes? Do you have a single template file or different templates for different uses? If you have only one, then if you name it default.sta (and store it in the right place), it will automatically open when you open VW. Or what about storing the import script as part of a template file. Then to get the script they have to open a new document from the Import Template and then run the script. Ask again if you need more information.
  7. Pat Stanford

    How to retrieve detail level in PIO

    I think you have to set the three object variables for each item that you wish to be controlled by the detail level. So for an object that will show in Low, Medium, and High Detail, you would need to set all three (750,751,752) all to true. For an object to display only at Low, you would set 752 to True and 750, 751 to False. For an object to display only at High you would set 750 to True and 751, 572 to False. Try this on a simple object and see if it does what you expect.
  8. @MullinRJ @JBenghiat @Julian Carr Can anyone provide a way to get a handle to a symbol instance on a drawing given only a handle to an object in the symbol definition? I have a symbol of a bathroom. Inside that symbol is a symbol of a toilet with a record attached. I create a worksheet and use a worksheet to pull data from the toilet symbol into separate subrows of a database. This works fine. Now I want to know where the toilet symbol I am pulling data from is located on the drawing. I can't figure a way to get that information. The worksheet location functions, Symloc or XCenter/YCenter in a worksheet script all return the location of the symbol in the internal coordinates of the bathroom (parent) symbol. The Handle to the toilet symbol is the same for multiple instances of the symbol. I need a way to get the location of the toilet, or even better a handle to the parent symbol instance. It seems impossible, but maybe the deep thinkers here can see something I can't. Regards, Pat
  9. Pat Stanford

    How to retrieve detail level in PIO

    It appears to be ObjectVariableBoolean Visible at XXX level of detail 750=High 751=Medium 752=Low So SetObjectVariableBoolean(Handle, 750, True) would make an object visible at high level of detail. If you also set 751 and 752 then it would be visible at all three levels of detail. GetObjecVariableBoolean(Handle,750) should return the if the object referenced by Handle displays at High detail level.
  10. Pat Stanford

    help with sheet layer visibilities

    Sorry about that. I intended to attach the file to my earlier post. Here is an example of one design layer with three objects each with the attached record and a field for "each viewport" Edit the worksheet or change the object in the OIP and what is shown in the Viewport will change. Artist Spikes Data Visualization.vwx
  11. Pat Stanford

    help with sheet layer visibilities

    As so often happens in VW, I am going to suggest a Record/Field and Worksheet solution. Viewports have a semi-new feature (as of VW2017 I think), called Data Visualization. You can change the attributes of object that meet certain criteria. In this case, I would recommend a custom Record be attached to the objects you want to be displayed for each artist. Create a Record named Artist Spikes. Create a Boolean field for each artist. To make it easily reusable you could name them something like A1, A2, A3, ... A14, etc. By setting them to boolean they will always be either on or off. Attache the Record to each object that you only want shown for some artists and check the boxes for each artist that that object is supposed to show. To make it easier to work with this, you could also create a Worksheet with a Database of objects with the record and a column for each artist. Format the columns as Boolean and you can control what is displayed for True and False, and you get a pull down that only lets you choose True or False for the field. In the viewport choose Data Visualization from the Shape pane of the OIP. Check the Enable Data Visualization for this Viewport. Choose the Record as being Artist Spikes. Since this is the Viewport for Artist 1, choose Record Field of A1. Set the False value under options to have a line weight of Zero so that objects without that field being true are drawn invisible. Set the Draw All Other Objects: to Normally. This means that objects that don't have the Artist Spikes record attached will be shown normally. Update the viewport. All of the spikes that are not being used for that artist should disappear. Duplicate the viewport, edit the Data Visualization to choose Record Field A2. You now have the viewport for Artist 2. Lather, Rinse, Repeat. The attached file shows a simple layout of 3 circles, but it should work for nearly any object. Double click on the worksheet at the bottom to put it in edit mode, change the worksheet values and the viewports should update. If they don't update automatically select them and choose Update from the OIP or select Update Selected Viewports from the View menu. Maybe too late for this show, but something to think about for future shows.
  12. Pat Stanford

    help with sheet layer visibilities

    It seems to me that your updating 14 VPs once so that all the stage managers needs to do is access the proper sheet is far less likely to cause problems that an unsophisticated VW user having to remember to turn on and off multiple classes to get the proper setting. But only you know your needs.
  13. Pat Stanford

    help with sheet layer visibilities

    Go to the Viewports pane of the organization palette. Choose Visbilities in the upper right instead of Details. You should now be able to run down the list of viewports and set the class visibilities for each relatively quickly and easily without having to go to each sheet layer, select the viewport, click on Classes and choose the right classes. For the future, if you use a uniform naming standard, it would probably be possible to write a script that would turn on the appropriate class to match the viewport. I am thinking something like having the viewport and class names the same but with different suffixes (i.e. Cher-VP, Cher-CL). But if you do this make sure you don't want multiple artist classes on in the same VP as part of the script would need to be to turn off all of the other -CL classes so you don't have to manually do that change.
  14. Pat Stanford

    Inaccurate Text Sizing

    None of the options you want exist in VW at this time. Best option is to do the best you can with getting the font close as discusses above. Then Convert Text to Polylines. Then rescale again if necessary. When I did this I was zoomed in almost 1000% when I did the initial measurement. When I measured the converted polylines I did get snap points and measured 3.003 mm. Do you need accuracy of better than 0.1%?
  15. Pat Stanford

    Inaccurate Text Sizing

    I think it is not working the way you want because the font contains extra space above and below the actual characters. Take a look at the Vertical Alignment options Top Base line and Bottom baseline. Also, I believe that internally all font sized are kept in points, so whatever you enter will be rounded to the nearest 10th of a point. You will have to enter the text you want and then measure to see what you have and then scale the text so it is the real world 3 mm you want. I just inserted a piece of text using Arial with a Page Size of 3mm. It inserted as 8.5 point. I then drew horizontal lines at the top and bottom of a capital letter I (i). They measure 2.145 mm. But some of the other character (number 3, lowercase s, probably others I did not try everything) match the top line, but extend past the bottom line. You will have to decide where you want to measure from and what should actually be 3 mm. I selected the text block and used the Scale Object:Symmetric By Distance option to measure what the current distance is and entered 3mm as the New Distance and the text scaled to be 3mm in height (measured from the capital I). Make sure you have the Scale Text check box checked and don't have the Entire Drawing check box checked.

 

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.

×