Jump to content

James Russell

Member
  • Posts

    398
  • Joined

  • Last visited

Posts posted by James Russell

  1. Just going to throw something in here that I was having a look at:

    http://developer.vectorworks.net/index.php?title=VS:SetWSCellNumberFormat

    Trying out both option 10 under the DO NOT USE category. Seems to somewhat work but didn't have the brain space at the time to play with option modifiers.

    Also I think there should be either modifiers for option 5 (Dimension) to enable Secondary Dimension choice, where you could easily have your two dimension sets or just create an option 14 for Secondary Dimension. It would make sense to have it as a modifier option so you could have Secondary Area and Secondary Volume also. Maybe it exists, maybe it's a wish.

    Love the formula though Michael, it's a crafty one!

    J

  2. Just thought I'd also pop in here.

    In the last 3 months I've been contacted by VW solutions staff on two occasions from issues I've posted here, both times with a formal email following up a query and solution/guarantees with both.

    This has restored my faith in the developmental side of VW staff and in my mind reinforces why we're all here.

    The occasional general 'Hi, that's something we're doing' wouldn't be too bad though! ;)

    J

  3. I was asked this question earlier this year and had a go at it late one night.

    I mainly wanted an isometric rendered preview pane, and it was quite effective for the most part.

    See attached now.

    Two Vectorworks windows open. One main file, design layers and all, this is the 'Working Document'. Then a second document open, this is the 'Preview Document'.

    Within the Preview document I referenced the Working document, and created a Design Layer Viewport using data from the Working document onto the Preview document's design layer. Anytime the reference file link is updated in the Preview document the flow-on effect update the Design Layer Viewport, meaning it's like a isometric preview panel.

    The point I stopped is when I hit a little issue of self updating time periods. I tried to alter the reference settings from the Organisation panel to auto refresh every minute, (I tried 0.1 mins but it wouldn't take it, Darn!), but it seems that this function isn't instantious anyway. It relies on saving of the source file... so I set the autosave to 1 min also for the Working Document. This has a flow-on effect, (depending how quickly you could open the two files respective to each other), of creating the required kick to force the update. All would be fine, except for the unavoidable dialog asking if you would like to update the references that are out of date, (no lovely do this every time check box here!).

    So is it possible, sort of.

    If there was a script that could run in the background and force an update of the reference file, which it should be noted when done manually applies changes even though the Working Document hasn't been saved, every 10seconds or so with no questions asked you'd be set!

    Anyways, good luck getting this implemented as a feature, I'm doubting VW has the power to support multiple windows in this capacity. Perhaps a preview pane style maybe.

    Cheers,

    J

  4. Ash,

    I've been playing with this issue for a while now and my answer so far is no. Without a record to reference, an entity counted by a database cannot create a numerical sequence purely within the database sub-rows.

    I'm hoping that someone is going to but in and have a clever way of =(CurrentSubRowNumber-CurrentRowNumber)*10 but I haven't found such an answer yet.

    I'll be interested to see though!

    J

  5. Rick,

    Just to give you another option, I often have to spec PSUs with showcase fixtures for exhibitions. You can always create a separate record for Power Accessories and check it to active if you have a PSU or switching device attached. I then have Vectorworks pull up Lighting Devices with this record attached and tally them up this way.

    It's just another way out of the possible hundred.

    Cheers,

    J

  6. You were so close Ash!

    ='Worksheet 1':B2

    The apostrophe is only required if the worksheet title has a space in it otherwise whole words are fine, eg.

    =Worksheet1:B2

    or

    =Worksheet-1:B2

    Keep asking these questions, it's useful for everyone ;)

    Cheers,

    J

  7. Micheal,

    I have done so with scripts in the past but was hoping for a really crafty way to do it within a worksheet cell.

    I know there's some strays in the VW device library but I have an idea that I'll have to try tonight.

    I'll see if I can change the Weight field in the lighting device xml to be a General integer with a trailing unit of kg, which is what I used to do in the past for appearance in my worksheet. Then seeing if VW will interpret the figures within the Light Info Record as integers with tags rather than text. It might just crash though translating the data across, guess we'll see.

    Otherwise you're probably right, I might just make a script with a ForEachObject loop taking out any letter components from the Weight field string and leaving the numbers and then just run a VALUE() over the whole field in the worksheet.

    I'll let you know how I go breaking things. ;)

    J

  8. Hey all,

    I want to analise the weight field of a Lighting Device as a value but I don't want to change the entire device library to do so.

    The current Lighting Device states the weight field as a 'Text' field so an example of weight is '11.3kg' as text.

    I want a worksheet formula which calculates the overall length of a field in characters, subtracts 2 places from the tail end and then converts it to a numerical value.

    A similar formula from Excel/Numbers would look like:

    =VALUE(LEFT(A1,LEN(A1)-2))

    Where field A1 contains the subject number with kg on the end, eg. '23.56kg'

    In my mind an easy translation to the header field of a worksheet with a database lookup for =DATABASE((R IN ['Lighting Device'])) would be:

    =VALUE(LEFT(('Lighting Device'.'Weight'),LEN(('Lighting Device'.'Weight'))-2))

    Unfortunately the LEN() and LEFT() functions do not exist in VW.

    Does anyone have an idea to move forward? If not collaborative discussion time?

    Cheers,

    J

  9. Hey all,

    Just wondering how I write the following IF statement. At the moment I have:

    IF (CkCnt=TRUE OR CkAll=TRUE) Then

    Begin

    End;

    Where CkCnt and CkAll are Booleans. I'm probably just missing a comma or bracket or semisomething or sleep.

    Any help appreciated.

    Cheers,

    J

  10. Michael,

    I had come to a similar solution last night but hadn't thought of moving the Value out, that's great!

    It's used in paperwork for two scenarios, one as you suggested in the theatrical world for subsidiary items such as bar extension on truss and counter-leavered arms. Secondly in the commercial exhibition world with custom created track layouts. I wrote a script a while ago that creates single and three circuit track as a lighting device from double-line/polygons which is great but there are some layouts such as figure-8 patterns that cannot be created from one loop of track, therefor the breakdown of 1.1, 1.2, 1.11, etc. This way the items of track can be identified independently but counted as a whole if needed.

    I just had a look at the help for the DIV function, does it always naturally round down?

    Cheers,

    J

  11. Hey all,

    I have a script which looks great but has little execution.

    I have a lovely dialog which has 10 checkboxes. When each of these are checked or not checked they save their data as a Boolean to 10 different Booleans labelled, ChkA, ChkB all the way to ChkJ.

    My question is what is the easiest way I can tally these up to find out how many are checked? I don't need to know which ones are checked just the total overall of how many are checked out of the ten and pop that number into an integer.

    Happy coding! ;)

    J

  12. Thanks Pat. I'm always missing parenthhesis all over the place. So that formula now works!

    Just so you know the background too all these is that I'm bringing a whole heaps of templates forwards to 2013. Last step, promise.

    I've now got a formula from my old template:

    =IF((('Lighting Device'.'Position')=''), 0, ROUND(VALUE(('Lighting Device'.'Position'))-0.499))

    In this situation the 'position' can only be entered as a number and the worksheet rounds it down to the nearest whole number, a formula I believe you helped me with years ago Pat. Working my way up to here I find that;

    =IF((('Lighting Device'.'Position')=''), 0, ROUND(VALUE(('Lighting Device'.'Position'))-0.499))

    Works with rounding but returns #Value errors for blank cells.

    =IF((('Lighting Device'.'Position')=''), 0, ('Lighting Device'.'Position'))

    Works but shows decimals places.

    =IF((('Lighting Device'.'Position')=''), 0, VALUE(('Lighting Device'.'Position')))

    #Value errors on blank cells, unrounded numbers on filled cells.

    =Any combination with ROUND() without VALUE()

    Fails with odd numbers presumably because 'Position' is a Text field.

    If someone gets a chance to check this over it'd be quite grateful, I'm just going in circles at the moment.

    Cheers,

    J

  13. Even though I feel like I'm having a conversation with myself (not unlike usual!) I've made a few interesting discoveries with the new Lighting Device that others might be interested in.

    Once a custom Lighting Device has been created it generates an xml file located within the user library; User>Library>Application Support>Vectorworks>2013>Plug-ins>Data.

    This file is the preferences file containing data for the field types and misc variables for the Lighting Device plugin, replacing the old Lighting Device.vso. Within each of the fields you'll find a single variable. In my case I've found pesky things like Unit Number as Text (kfieldText) and replaced it with and Int (kfieldLongInt) in my case. This still appears to be a locked value by the over GUI component of the Lighting Device but seems to operate as normal at this stage.

    Unfortunately I still haven't found a way to add Pop-up list options to the Lighting Device and although I can create them through the xml file I can't seem to add listing options at this stage.

    Obviously if you're going to text this along with me backing up files and using at your own risk is important here. I'll let you all know how it goes!

    Still working on the post above, let me know if you have ideas!

  14. I've solved my own problem to a degree but it raises another issue.

    The field for 'Unit Number' as defined by the Spotlight Document settings>Lighting Device properties is a Text field. By inserting the VALUE() command around ('Lighting Device'.'Unit Number) the IF statement returns a correct result. Unfortunately this field is locked and cannot be changed without editing the xml file... (I'm working on it right now ;) )

    On another column over though I want to test an ISBLANK equivalent on my positions. About half of my lamps have a position, half have nothing in the field.

    Following the help example for IF statements: if (logical_test, value_if_true, value_if_false)

    I put in the formula =IF('Lighting Device'.'Position')='', 'BLANK', 'NOT BLANK')

    To my surprise the formula disappears and is replaced with =('Lighting Device'.'Position')='' to which all fields reply with a true or false not my text as requested.

    Ideas...?

  15. Hi all,

    I've struck a problem jumping between 2010 and 2013, just want to see if someone can replicate it.

    I've got a worksheet listing several Lighting Devices with unit numbers from 1 to 200 in this example. So the database search criteria is =DATABASE((R IN ['Lighting Device'])) meaning all lights are picked up.

    So there's 200 line items now and I'm putting a formula into cell A1 which will define the whole column's formula.

    =('Lighting Device'.'Unit Number')

    This gives me the numbers 1 through 200 as I expect.

    Now I do the same in B1.

    I've chosen an if statement which I thought used to work:

    =IF(('Lighting Device'.'Unit Number')>50, 'Greater than 50', 'Less than 50')

    But alas all the results returned are 'Greater than 50', when I would expect the first 50 in this example to say 'Less than 50'.

    Other operations that I still have in templates like ROUND() and VALUE() are working yet IF doesn't seem to.

    Can someone replicate/investigate/solve?

    Cheers,

    James

  16. Hi all,

    It's been a while but I finally made it back to the forums.

    Had and interesting question from a student today and I couldn't find the answer.

    The question is:

    When we're in a Top/Plan view you can clearly see the infinite active layer grid, and when we move to a 3D isometric view it is present there as well but restricted, not infinite. Is it possible to extend this grid to either a larger size or make it infinite?

    Hope you're all well.

    J

  17. I was just doing a whole heap of distance calculations and had never used LONGINTs before now. Used them when I realised that it was levelling out on higher number sets.

    Is there a low limitation to using LONGINTs more often? What are the advantages/disadvantages? Presumable they are slightly larger data wise which may cause an accumulative slow down in loops... But what else do they do?

    J

×
×
  • Create New...