Jump to content

Pat Stanford

Moderator
  • Posts

    12,593
  • Joined

  • Last visited

Posts posted by Pat Stanford

  1. You will only be able to copy/paste into fields that are displaying Record.Field data.  

     

    Columns that are displaying object data (like the X/Y/Z position) can't be pasted into. At least not as multiple lines at once.  And if you did paste into them, it would move the objects in the drawing to the location specified by the values you pasted in.

     

    And there was a bug in VW2023 that did not allow pasting into multiple database subrows.  I believe that has been fixed, but I have not tested in 2024 or later releases of 2023.

  2. Try this one line script:

     

    SetPref(5, NOT(GetPref(5)));

     

    Long ago there was a user preference to show extension lines on loci. The interface to that was removed over a decade ago, but the ability still exists with the proper script. It looks like somehow it got turned on in your file.  The above script will toggle that preference on and off.

    • Like 2
  3. Open the folders in the left hand pane and click on the VWX files in the folders and you should see the symbols in that file.

     

    Or just type what you are looking for in the search Baar at the top and hit return. It will show you all the items that have that search term in their name. So start with something generic like Table.

  4. At least in the US and UK, perpetual licenses are no longer available to new users, only subscriptions.

     

    If you purchase a used perpetual license you will be able to use it until your hardware or operating system no longer support it, but you can't get a Service Select subscription so no upgrades will be available.

     

    I am not certain of the restrictions in France. 

  5. Take a look at this thread. It might help you do what you are trying to do.  The only way I know of to make a worksheet of Resources instead of placed objects.

     

     

  6. I use all the modes on a fairly regular basis.

     

    I use the first mode when I know I am moving things and don't want to accidentally change their size.

     

    I normally us the second mode for regular drawing.

     

    I switch to the third mode when I occasionally realize that I need to resize multiple objects at once.

     

    And I have not gotten into the habit of using the new 4th mode yet.  Maybe on the next project.

    • Like 3
  7. To amplify on what Tom says, all data in a Worksheet Database Row has to live somewhere. That somewhere can be a Record.Field combination or as part of some calculation. You can't just type text into a Database cell that is not linked to something to store it.

     

    Databases are dynamic. When you add or subtract objects in the file the order of the objects in the database can change. So you must store the text in a Record.Field so it will be "connected" to the object and display on the proper row of the database as things change.

     

    You can either use the Plant User Fields, or you can create your own Custom Record and use a field in that for your notes.

     

    HTH

    • Like 1
  8. If you create a database of Materials instead of Objects then you should be able to get the record data from the Materials.

     

    Worksheets are not really able to get information about Contained or Container objects (Parents or Children) directly. Only about the object specified directly by the criteria.

     

    The possible work around would be to use Worksheet Scripts to get the data.

  9. @Ryan Russell  I wrote this up a few months ago for another user. It might be applicable to your question and @klinzey's comment about Python.

     

    Quote

    There are good and bad points to both Vectorscript and Python.

     

    Vectorscript is based on Pascal, which was one of the most popular languages when I was in college in the mid 80s. So it was pretty easy for me to pick up VS coming from Pascal.  Pascal was designed as a learning language to teach programming. So it has a number of "features" that are designed to make it easier to learn, but that mean you have to type a little more. For example every "block" of code needs to be surrounded by Begin and End statements and every line has to end in a semicolon. But it is also a compiled language, so these types of "syntax" errors are found in the compile step (usually) and not when you try and run the program. A huge percentage of the early Mac software was written in Pascal. But it is no long a "popular" language, so almost any learning materials you can find will be from before 2000. The age doesn't matter since the language has not changed, but the availability of those resources could be an issue.

     

    Python is a much more modern language, currently very popular, with a huge number of "libraries" available to perform almost any action you need. Vectorscript functions as a library inside of Python. So this means that Python can not do any more than Vectorscript inside of VW. But if you need to access data from the web, do sophisticated math or matrix operations, or even just text processing, then Python can be a huge benefit and timesaver. It also has a large range of current training materials. Python is an interpreted language, meaning there is not syntax checking step before the script is run. So rather than a quick sanity check for typos, you end up running the program and it stops when it hits an error.

     

    There are a couple of Python syntax issues that I personally dislike (hate). First, I am a poor typist, and if you have read many of my posts, you know I have a very strange idea of capitalization.  Python is "case sensitive" meaning that variables name Variable, variable, vAriable, VARIABLE are all different. In Pascal those are all treated as the same thing, which is a huge benefit for me during development. (I try to fix/standardize cases when I am finishing a script.)

     

    The second issue I have with Python is that it is "White Space Delimited". This means that to make a block of code all you have to do is indent every line the same amount rather than the extra typing of Begin/End. But to me, this makes it much harder to read the code as there are no markers for where a block begins or ends. Also for a poor typist, having an extra space somewhere in a page of code can completely change how the code executes. And Python treats spaces and tabs differently, so you should really pick one or the other for indenting code an always use that one. Even if two lines look like they are indented identically, if one has a tab and the other 4 spaces, the Python interpreter will not see them as part of the same block.

     

    Benefits/limitations inside Vectorworks

     

    Vectorscript has functions that will wait for the user to click and then collect that data for use later in the script. Python inside VW is that it does not have a way to pause while waiting for a mouse click and work arounds are required to get data input from the mouse.

     

    Vectorscript uses only the single quote mark to delimit strings. And also uses the single quote as the marker for units in feet. This means that you can end up with cases where you have to go to extra lengths to "escape" the single quotes if you need them inside of a string.

     

    Python allows you to use both single and double quotes which can minimize this, but then can have the same types of issues with inches and double quotes.

     

    Benefits/limitation outside of Vectorworks

     

    Python has a huge number of libraries to allow access to web data in almost any format. You can bring in data with just a few library calls. Vectorscript has very limited ability to access outside data. You can read and write text files and XML files, but looking up data on a web site is difficult/impossible.

     

    Pythons library for math/matrices/text handling give it a huge edge is you are doing these functions. Vectorscript has basic capabilities in these areas, but there are things Python can do that VS can't.

     

    So Which Is Better?

     

    It depends on what you are planning to do.

     

    Since the Vectorscript functions are just a library inside of Python, you have to learn that no matter which language you use.

     

    There are many more examples to learn from in Vectorscript that in Python currently, but the number of Python scripts posts is growing quickly.

     

    If you are planning to just write relatively small scripts to create/modify/queary objects in a drawing, I would recommend Vectorscript. While there are fewer learning resources, I think there are enough and beyond a few language specific items most of the questions are going to be about Vectorscirpt specific functions, not how the language works. The Vectorsciript Language Guide https://developer.vectorworks.net/images/7/72/VectorScriptGuide.pdf does a pretty good job our outlining how the language works.

     

    If you are looking to do large projects, especially ones that need to access data from outside of VW or if you want to be able to take more of what you learn about programming and apply it in a different environment, then pick Python.

     

    In either case, you have picked a great place to learn to program as we have an experienced, friendly, and generous group of coders in both languages. Don't ever hesitate to ask for help. We have all been at the beating our heads on the desk stage many, many times and will be happy to help bring another scripter into the fold.

     

    Pat

     

    • Like 1
  10. The 12" Truss is using the VW standard of the bottom of the bottom chord being at the insertion point.

     

    The 16" truss is using the center of the truss as the insertion point.

     

    Edit the 16" Truss Symbol and move it up 8" and you will have a symbol that will work like the 12"

    • Like 1
  11. There appears to be a problem with the VSEL criteria.

     

    In a worksheet the VSEL returns as TRUE for a selected object.

     

    Inside the Marionette it does not seem to return any items.

     

    Could you expand your criteria to be SEL & Type is Symbol and get it to do what you want?

     

    @Marissa Farrell Can you comment on using VSEL criteria inside a Marionette Menu Command?

    • Like 1
  12. My guess is that you have the Update Viewports option selected in the Publish command.  So it doesn't matter if you have already made bitmaps, the update of the viewports will still take as long.

     

    If the above is not the case, then it sounds like something else is wrong. and as Jeff says, without a file to look at it is all guesses.

    • Like 1
  13. Or if you want them all in a single database you can get fancy.

     

    image.png.350f2a645dab76392278f9584d3497ef.png

     

    But then you will also have to use fancy IF formulas also.  And you will lose the 2-way ability to change the object from the worksheet, but I think the VALUE command already does that.

     

    Here is the revised formula for Columns A and B.

     

    Col A
    
    =IF(Style.'Name'<>'', Style.'Name', SYMBOLNAME)
    
    
    Col B
    
    =IF(OBJECTTYPE=15, 1, VALUE(OBJECTDATA('INVENTORY PART PARAM', 'Curtain', 1, 5)))
    

     Col A shows the SoftGoods name there is one, if not, it shows the Symbol Name.

     

    Col B checks if the object is a symbol and if so it sets the count to 1 otherwise it uses the original formula.

     

    And I recommend that you dump this test file, or at least the worksheet you have been using. There is something really funky about the cell formatting that is causing problems.

    • Like 1
  14. I don't think you can use the SEL or VSEL criteria and also use a Marionette object in the drawing.  In order to run the Marionette, you have to select it.  This means that you will not have anything else selected on the active Layer.

     

    SEL and VSEL could be used if you wanted to make a Marionette Menu Command, but as a tool they won't work.

  15. I know that worksheet functions work in Data Tags when surrounded like:

     

    #WS_SomeWorksheetFunction(XXXXX)#

     

    It can be more complicated than a single function so you can get two values and multiply them and return the value as a string or something similar. Or use nested IF functions if necessary.  But between the #WS_ and the ending # all of the "terminology" must be worksheet terminalogy only.  You can't mix Data Tag functions into the middle of a worksheet function.  So you would have to use 'Record'.'Field' and not #'Record'#.#'Field'#

     

    I believe that WS functions can be used in other dynamic text locations as well, but they may be much less useful.  The 1:1 relationship between a Data Tag and an object in the drawing basically acts the same as the 1:1 relationship in a Worksheet Database Subrow. This means that you can access the data associated with that specific object. Other object types that use Dynamic Text probably don't have the 1:1 relationship with an object so many of the WS functions will not operate properly.

     

    But that last paragraph is almost entirely a guess on my part. Or at least I can't remember the results of any tests I have run to prove it right or wrong.

  16. Another way to think about the Ternary (@ Colon) operators is:

     

    Display the stuff before the @

     

    If the stuff in the middle evaluates to false then display the stuff after the colon.

    • Like 2
×
×
  • Create New...