Results 1 to 5 of 5

Thread: Can't find parameter to change it

  1. #1
    Active Member some buddy's Avatar
    Join Date
    2009-04
    Posts
    85
    0 Did you find this post helpful? Yes

    Default Can't find parameter to change it

    Hi,

    Here is a question that might be simple for most contributors here, but I'm stuck.

    I have a structural model and a routine that inserts a Generic Family symbol (a little tag) at specific coordinates:

    Code:
    dbDoc.Create.NewFamilyInstance(InsPoint, symbol, StructuralType.UnknownFraming);
    The Family has a Text type, Shared and Instance parameter (see attached image), whose value by default it’s an empty string.

    I would like to change the value of the parameter after the insertion, with the value (X, Y, Z) of the argument InsPoint used for the insertion, so that the tag becomes more visible.

    I’ve been able to find a lot a parameters (family, symbol, instance, type) but not this one!

    I'm convinced that it's something very simple, but I'm giving up!

    Can anybody help, please?

    TIA,

    Buddy
    Attached Images Attached Images

  2. #2
    Member
    Join Date
    2012-09
    Posts
    28
    0 Did you find this post helpful? Yes

    Default Re: Can't find parameter to change it

    Something like this:
    Code:
    FamilyInstance familyInstance = dbDoc.Create.NewFamilyInstance(InsPoint, symbol, StructuralType.UnknownFraming);
    
    string coordinateString = InsPoint.X.ToString("F2") + ", " + InsPoint.Y.ToString("F2") + ", " + InsPoint.Z.ToString("F2");
    
    familyInstance.get_Parameter("XYZ").Set(coordinateString);
    I'm assuming InsPoint is an XYZ point, if it's not then adjust the code accordingly.

    double.ToString("F2") will cause the number to appear with 2 decimal places

    The above code will also need to take place during a Transaction.

  3. #3
    Active Member some buddy's Avatar
    Join Date
    2009-04
    Posts
    85
    0 Did you find this post helpful? Yes

    Default Re: Can't find parameter to change it

    Thanks cshha,

    That was really simple, I think I was way too tired because of all the trial-error efforts of yesterday and somehow, I couldn't see the forest for the trees

    Regards,

    Buddy

  4. #4
    Member
    Join Date
    2012-09
    Posts
    28
    0 Did you find this post helpful? Yes

    Default Re: Can't find parameter to change it

    No problem. In future you should take a look at RevitLookup (part of the SDK) or BipChecker, which both let you examine all of the parameters of an element

  5. #5
    Active Member some buddy's Avatar
    Join Date
    2009-04
    Posts
    85
    0 Did you find this post helpful? Yes

    Default Re: Can't find parameter to change it

    I will, thanks.

    Buddy

Similar Threads

  1. Find all solid hatch and delete/change lisp
    By terryh in forum AutoCAD Customization
    Replies: 8
    Last Post: 2013-06-21, 10:55 PM
  2. Change Project Parameter to Shared Parameter?
    By kgodfrey in forum Revit Structure - General
    Replies: 0
    Last Post: 2008-11-12, 03:43 PM
  3. (Structural) How to read/change a parameter
    By ppirtle in forum Revit - API
    Replies: 6
    Last Post: 2008-04-18, 03:27 PM
  4. Can not find Change Space command in ADT 2007
    By klowery in forum ACA General
    Replies: 7
    Last Post: 2006-07-28, 12:44 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
  •