Announcement

Collapse
No announcement yet.

New API utility

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

    New API utility

    Sorry if this is not the correct place for posting, but this solves some issues I always had and usually found in support posts.
    So, while tired of coding a big project I stoped and made this tiny DLL (less than 100 lines of code).
    When you run it, he looks for some parameters of certain types:
    "HandFlipped" type Yes/No, "FacingFlipped" type Yes/No, "Mirrored" type Yes/No, "Pinned" type Yes/No, "Group" type Text and "Super" type Text.
    And doesn't care if the parameter is shared or not.
    When you run the dll, the app will fill those parameters whenever it finds them. The DLL also does not care about categories, so you can use it with any.
    So, no more excuses for not making left/right door schedules or finding the mirrored curtain panel.
    The "Super" parameter will be fill with the Mark of it's supercomponent, so also no more complains about not being able to find the family where that shared component was inserted and manage that.
    The "Group" parameter does exactly that: gets the group name if that component is in a group.
    I have not made a manifest file, but you can run the DLL with the Add-In Manager that comes with the SDK (automatic mode, by the way).
    Well, that's it.
    Enjoy
    Attached Files
    Gonçalo Feio
    "Ignorance, ignorance, sheer ignorance - you know there's no confidence to equal it. It's only when you know something about a profession, I think, that you're timid and careful." George Orson Welles

    #2
    I don't quite understand what this is. Any more info or images of schedules,please ?
    Mark Balsom

    If it ain't broke, fix it till it is.

    Comment


      #3
      Sorry, Mark.
      Try this: create a yes/no parameter called "HandFlipped" (exactly as that) put it in a schedule (door, for example), Create a few doors and flip one or two and run the DLL.
      The ones that are flipped will report yes in the schedule.
      Same goes with the other parameters I stated.
      Mind that it will only work with categories that have the parameter assigned.
      Give it a try.
      Gonçalo Feio
      "Ignorance, ignorance, sheer ignorance - you know there's no confidence to equal it. It's only when you know something about a profession, I think, that you're timid and careful." George Orson Welles

      Comment


        #4
        Originally posted by feio View Post
        Sorry, Mark.
        Try this: create a yes/no parameter called "HandFlipped" (exactly as that) put it in a schedule (door, for example), Create a few doors and flip one or two and run the DLL.
        The ones that are flipped will report yes in the schedule.
        Same goes with the other parameters I stated.
        Mind that it will only work with categories that have the parameter assigned.
        Give it a try.
        hmmm... interesting! That could easily come in handy some day Thanks for sharing :beer:

        BTW, moved this thread to the "API" forum.
        Klaus Munkholm
        "Do. Or do not. There is no try."

        Comment


          #5
          This is FREAKIN AWESOME! In Holland all contractors are whining about the impossibility to schedule mirrored/flipped doors. Nobody ever took the time to create something like this. I have been wanting to learn the API just so I could write this.

          BTW: hope you don't mind if I try to convert this to Dutch. Will be a nice excersize.
          Martijn de Riet
          Professional Revit Consultant | Revit API Developer
          MdR Advies
          Planta1 Revit Online Consulting

          Comment


            #6
            Yep, cleaver, very very cleaver. :thumbsup:
            Attached Files
            Mark Balsom

            If it ain't broke, fix it till it is.

            Comment


              #7
              Feio, a little bit of guidance if that is possible please. If I (as mdradvies does) want to re-word the parameter names is that something a complete novice to API ,like myself could do. If so where and how do I start. I think this would be a great example to start learning API with.
              Mark Balsom

              If it ain't broke, fix it till it is.

              Comment


                #8
                Originally posted by mark b View Post
                Feio, a little bit of guidance if that is possible please. If I (as mdradvies does) want to re-word the parameter names is that something a complete novice to API ,like myself could do. If so where and how do I start. I think this would be a great example to start learning API with.
                Mark, for simplicity sake I used the original methods names for the parameters (exept for "Super" - the method name is really "SuperComponent" but lazyness won). And really didn't care much about it, since you can override these names in the schedule header.
                The whole point was making it work with just 2 lines of code per parameter: one to verify that the parameter is assigned and is of the correct type and the other line to update it.
                Gonçalo Feio
                "Ignorance, ignorance, sheer ignorance - you know there's no confidence to equal it. It's only when you know something about a profession, I think, that you're timid and careful." George Orson Welles

                Comment


                  #9
                  Originally posted by mark b View Post
                  Feio, a little bit of guidance if that is possible please. If I (as mdradvies does) want to re-word the parameter names is that something a complete novice to API ,like myself could do. If so where and how do I start. I think this would be a great example to start learning API with.
                  Feio, the problem isn't in the schedules but in the actual parameters name. I would like to change this to Dutch standards, as we already have a User Group nationwide Shared Parameter File in which I would like to see these parameters set up.

                  Mark, my take would be to make a copy of the DLL and open this in Notepad. Simply look up all references to the parameters and change the naming. I don't have a clue if this will work but it seems worth a try (since there's only 100 lines of text in the DLL). After this, test it and see how we go from there...
                  Martijn de Riet
                  Professional Revit Consultant | Revit API Developer
                  MdR Advies
                  Planta1 Revit Online Consulting

                  Comment


                    #10
                    Originally posted by mdradvies View Post
                    , my take would be to make a copy of the DLL and open this in Notepad. ...
                    Sorry, that's not the way DLLs work.
                    A .DLL is a complied file and is in Binary. While you might be able to recognize a few things if you open it in Notepad, most of it will look like gibberish. You won't be able to edit anything, and you'd certainly break it if you tried to change anything.
                    You'll need to get the original C# or VB.Net code and re-compile it.

                    Opening a dll file in Notepad would be about as useful as opening a Revit file in Notepad.
                    Dave Plumb
                    BWBR Architects; St Paul, MN

                    CADsplaining: When a BIM rookie tells you how you should have done something.

                    Comment

                    Related Topics

                    Collapse

                    Working...
                    X