Hi, I'm trying to have a report according to my needs.

I've an attribute named dc: um  that's coming from the seed component.  Is a choosing dropdown list:  mq, mc, kg, etc..

particularly:

the field     cost_tot       should be conditioned in this way:

IF     dc: um     is equal to    mq (according with is it choose in the dc list)  

    THEN   cost_tot    is    =  %a-m% * cost_unit  (first operator could change for ex in %v-m% if is listed mc .. and so on)

I'm novice both SD both Ruby.

Could yopu help me?

Many thanx

Pier

I link file for analysys.

http://dl.dropbox.com/u/255954/space_design_test.zip

You need to be a member of Render Plus Software to add comments!

Join Render Plus Software

Email me when people reply –

Replies

  • Hi Greg,
    I cannot test now, 'cause I'm going to sleep (italian time)
    Tomorrow morning I will upload something on which I'm working on...
    Hedache!
    Ciao
    Pier
  • Hi Pier,

    I can see that you have tested the option already.

    I typed my post yesterday and I paste it Today :) amended online but it took me more than 10 minutes and my time for changes was up !

    Regards

    Gregory

  • Hi Pier,

    Have a look the Ruby operators.

    http://www.tutorialspoint.com/ruby/ruby_operators.htm

    Based on Al's example and changing the DC 'Value' to 'NUMBERS' (your component uses 'TEXT' in 'Value') where:

    - 'm2' is '1'

    - 'm3' is '2'

    the Ruby works - PAO.pdf report attached

    %dc: um% == 2 ? %cost_unit% * %area% : %cost_unit% * %volume%

    Probably you have tested the option described above.

    The downside is - you cannot get the 'UM' as 'm3', 'm2' on the SD report (or I don't know how to do it)

    Regards

    Gregory

    PAO.pdf

  • Hi Gregory,
    Yes, you are in the right. I think that the problem belongs by text argument (m2, m3, ...) in numeric field. This could be confirmed by the fact that if you substitute m2 with 1, 2, etc. the Ruby seems to do his job.
    Only Al, I think, could dig inside the question.
    I'll wait.
    All the best
    Pier
  • Hi Pier,

    I don't know Ruby but looking at some examples online like:

    x=1
    if x > 2 puts "x is greater than 2"
    elsif x <= 2 and x!=0 puts "x is 1"
    else puts "I can't guess the number" end

    and substituting the case expression (x=1) and conditions (if ... , elsif ... , else ...) to

    %DC: um%=m2
    if %DC: um%=m3 puts %cost_unit% * %volume%
    elsif %DC: um%=m puts %cost_unit% * %DC: lenx%
    else put "way of measurement is not defined" end

    I wonder if the case expression (%DC: um%=m2) should be numeric (number) rather than letter + number (m2) ?
    I think Ruby has some problem with the m2.

    Otherwise we have to dig somewhere else.

    Al,
    Is my thinking correct or am I completely wrong.

    Regards
    Gregory




  • Hi to all crew,

    That's true, I'vethe same problem with imput capital letters in DC. Report seems to work the same, but I'm still waiting for some help for my ruby script problems. I've seen as Gregory work it out the report for different unit_measure, but I'm serching for more synthetic solution. 

    Anyway thank you Gregory

    ciao

    Pier


    GTM said:

     

    Dear Al,

    I have the latest version of SD (LD30sd) and all the dynamic components attributes (DC: ...) cannot be input in CAPITAL letters. Only one of them can be in capital DC: the rest is automatically changed to lower case dc:. At the same time it would allow you to EDIT the lower case attribute to be capital but subsequently removes/changes the previously set to lower case.

    2506659275?profile=original2506659310?profile=original

    Regards

    Gregory



  • Al Hart said:

    The dynamic component attributes should have DC: in capital letters.

    However, when I try to change it, it is converted back to lower case.

    I will need to fix this and get you a new version.

    Al

     

    Dear Al,

    I have the latest version of SD (LD30sd) and all the dynamic components attributes (DC: ...) cannot be input in CAPITAL letters. Only one of them can be in capital DC: the rest is automatically changed to lower case dc:. At the same time it would allow you to EDIT the lower case attribute to be capital but subsequently removes/changes the previously set to lower case.

    2506659275?profile=original2506659310?profile=original

    Regards

    Gregory

  • Thank you, tomorrow I'll be on vacation. Wensday I'll test... Do you mind to help me with my Ruby script? (see my post of April 27th.ciao
    Pier
  • We posted a new version of SpaceDesign (see Downloads above) which will read dynamic component values from groups.

    You will still have to enter the "dc: um" attribute name by hand. We read through all component definitions to find dynamic component names, but I did not want to have to read through all groups.

    Give it a try and let me know if it works for you.

  • Dear Pier and Al,

    I'm watching your discussion about DC and the Tak2Ata plugin. I can only assume that Pier is talking about BST Building Structure Tools0.5.4 update Dec18, 2011 http://forums.sketchucation.com/viewtopic.php?t=35798.

    I'm testing the plugin and I'm thinking how much info I could extract from the DC elements using SD.

    Regards

    Gregory

This reply was deleted.