Results 1 to 4 of 4

Thread: Combining 2 family length parameters and return as text

  1. #1
    All AUGI, all the time clog boy's Avatar
    Join Date
    2006-12
    Location
    Probably near a PC.
    Posts
    843
    Login to Give a bone
    0

    Default Combining 2 family length parameters and return as text

    Hi, I'm new to the Revit api but have some (very little) experience with writing macros. Maybe a similar question has been asked before, in this case feel free to point me to the right direction. However I searched the internet and came up emptyhanded.
    Right now I'm creating rectangular duct fittings, and the client wants to read the duct size(s) in a standardized paremeter. The default Revit 'size' parameter in the project is not suitable, it really needs to be a shared family parameter. The output format is basically "largets_duct_size x smallest_duct_size".
    What would be a good way to fetch the duct size and return that as a string? Is it possible at all to dynamically fetch and throw between the family and the macro whenever the duct size changes?


    Thanks in advance, B. Weinreder

  2. #2
    Active Member
    Join Date
    2011-11
    Location
    Saint-Omer, Pas-de-Calais, France
    Posts
    58
    Login to Give a bone
    0

    Default Re: Combining 2 family length parameters and return as text

    You can use DMU (Dynamic Model Updater) to track the changes and update your shared parameter: http://adndevblog.typepad.com/aec/20...arameters.html

  3. #3
    All AUGI, all the time clog boy's Avatar
    Join Date
    2006-12
    Location
    Probably near a PC.
    Posts
    843
    Login to Give a bone
    0

    Default Re: Combining 2 family length parameters and return as text

    Am I right that this should be executed manually in the project? What I would prefer is an automatic update in the family itself. As I was made to understand, the Family api is slightly different from the Revit api that's used to create new features and add-ins etc.
    What's typical about duct fittings is that for every change, Revit will re-generate the fitting, using the first in line with its default values, that can then be changed for a compatible fitting, and then finetuned using it's own family parameters. But the bottom line is that a duct fitting will be re-created when you modify the ducts. This event of creation should trigger a routine that reads the duct sizes through the connector, and generates a string that should be placed in the formula field of a tekst parameter.

    So this event of creation should trigger:
    -read instance parameters that are related to the connector size and convert to integer
    -sort descending
    -place in string
    -put string in the formula field of the appropriate parameter

    This should be easy, right? /underestimation

  4. #4
    I could stop if I wanted to TroyGates's Avatar
    Join Date
    2015-08
    Location
    Irvine, CA
    Posts
    281
    Login to Give a bone
    0

    Default Re: Combining 2 family length parameters and return as text

    The API doesn't have event triggers for object modification. But you could have code run on save/sync, print, or open/close events that will update the parameters. I have something similar that updates parameters for mechanical equipment tags. It runs every time the model is saved or printed.

Similar Threads

  1. Return Width and length of square polyline
    By T_Livingston in forum VBA/COM Interop
    Replies: 5
    Last Post: 2010-03-04, 01:27 AM
  2. Mixing Text & Length Parameters in a Formula
    By msinclair.138873 in forum Revit - Platform
    Replies: 0
    Last Post: 2008-07-21, 02:24 PM
  3. Combining family files
    By CBroda in forum Revit Architecture - Families
    Replies: 1
    Last Post: 2007-08-10, 08:16 PM
  4. Combining Parameters to form a new Parameter
    By emercer1 in forum Revit Architecture - Families
    Replies: 3
    Last Post: 2004-06-18, 06:04 PM
  5. Shared Parameters: combining unit names, areas, etc.
    By ben in forum Revit Architecture - General
    Replies: 4
    Last Post: 2004-02-20, 04:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •