Announcement

Collapse
No announcement yet.

Line weight settings via API

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Line weight settings via API

    I am hoping to dabble in Macro creation while also fixing the @%#$ silly bit where Revit forces it's own line weights into a family when you Edit the family from project Browser. I use line weights 10-16 as non scaling line weights, and having all my hidden lines and elevation swings (line weight 11) suddenly huge when editing a family is just annoying. Anyway, I HOPE to address this, but so far as I can find mucking about in the Object Browser, there is actually no access to settings like this? Am I right in this assessment? I was also hoping to use a macro to address Unit settings as all the unit settings in every single family template are bogus. A macro to fix em as I build my own templates would be dandy. Again, seems this has not been exposed?
    Hoping someone can point out where I am missing the obvious! Been a long while since I did code, and that was VBScript and hardly counts, so I fell more than just a little behind.

    Thanks,
    Gordon
    Pragmatic Praxis

    #2
    HI Gordon.

    I don't have any idea about line weights but could have a look when I get some time. As for the family units they can be changed as per the code below;

    Code:
     Dim oProjectUnit As ProjectUnit = doc.ProjectUnit
     Dim oFormatOptions As FormatOptions = oProjectUnit.FormatOptions(UnitType.UT_Length)
    
     Dim t As New Transaction(doc, "Door Factory")
     t.Start()
     oFormatOptions.Units = DisplayUnitType.DUT_DECIMAL_INCHES
     oFormatOptions.Rounding = 0.001
     t.Commit()
    Cheers

    Phillip
    Phillip Miller
    Kiwi Codes Solutions Ltd
    Makers of "Family Browser" and "Project Browser" for Revit.

    Comment


      #3
      Thanks Philip. Glad at least part of what I am trying to do is possible. Amazing how large the object model is. And that with so much stuff still missing. Crazy complex. Hopefully I can get my head around it, and perhaps around C# as well. If I have to punt to VB.Net I will, but I would like to learn some C#. Inches me closer to being able to code in Obj-C/Cocoa!

      Gordon
      Pragmatic Praxis

      Comment


        #4
        Hi Gordon.

        Not a problem.

        Yeh C# would be the way to go. Heaps more Revit code samples for it.

        Good luck.

        Cheers
        Phillip
        Phillip Miller
        Kiwi Codes Solutions Ltd
        Makers of "Family Browser" and "Project Browser" for Revit.

        Comment

        Related Topics

        Collapse

        Working...
        X
        😀
        🥰
        🤢
        😎
        😡
        👍
        👎