Quantcast
Channel: RevitNetAddinWizard & NavisworksNetAddinWizard
Viewing all 872 articles
Browse latest View live

NavisworksNetAddinWizardPro

$
0
0

NavisworksNetAddinWizardPro (Navisworks .NET Addin Wizard Professional) has been worked out with months of effort.

The latest build of NavisworksNetAddinWizardPro (Navisworks .NET Addin Wizard Professional) can be downloaded from the following left image/link. If you find it useful (e.g. saving huge efforts, avoiding error-prone operations, sorting tricky issues quick and easy, debugging straightforwardly, coding more efficiently, etc.), please make a kind donation by clicking the following right image/link so that our resources could be expended a bit and you will get better and timelier products, services and contents. We appreciate it very much!

 Download the latest NavisworksNetAddinWizardPro

                

Besides bug fixes, it has been enhanced dramatically and tested diligently to support all mainstream Visual Studio editions (such as Standard, Professional, Universe and Community) and versions (2013/2012/2010/2008). As always, it supports a variety of Navisworks editors/flavors (such as Navisworks Freedom and Navisworks Manage) and many popular versions (2015/2014/2013/2012/2011/2010).

Please feel free to post comments or contact us should you have any concerns about NavisworksNetAddinWizardPro.


Visual Smarter Came Out

$
0
0

We separated out many widgets and coders to form a new add-on for Visual Studio from those existing various .NET Addin Wizards.

RevitNetAddinWizard(Pro)                                -  (http://spiderinnet.typepad.com/)

AcadNetAddinWizard(Pro)                                -  (http://spiderinnet1.typepad.com/)

InventorNetAddinWizard(Pro)                          -  (http://spiderinnet2.typepad.com/)

NavisworksNetAddinWizard(Pro)                     -  (http://spiderinnet.typepad.com/)

 

Its name is Visual Smarter, which is designed to make .NET coding easier and smarter.  Another blog introduces features of the tool in more detail and provides download and maintenance for Visual Smarter.

http://visualsmarter.blogspot.com/

Welcome to stop by and leave any comments.

Revit .NET: Group Revit ParameterType Enum Values (based on Revit Discipline)

$
0
0

We discussed about a similar topic, created some code, and posted another article long time ago.

Revit Units .NET API: Group Revit Unit Types (based on Revit Discipline)

The discussion and code in the post was focused on the UnitType enum values. Things were relatively easy there as the Revit .NET provides a straightforward API (UnitUtils.GetUnitGroup(UnitType)) to get the unit group that the unit type belongs to. The Revit .NET UnitGroup enum values indicate right the so-called disciplines, from the Revit User Interface perspective.

We’d like to do similar grouping to the Revit .NET ParameterType enum values as well, but found things are much more difficult. Revit itself internally groups those ParameterType (Type of Parameter as in the UI) well based on the Revit disciplines but obviously that functionality has not been exposed to outside. The Shared Parameter Editor of Revit can prove that:
SharedParameterEditor

In terms of those ParameterType enum values, they are pretty arbitrary, not following any certain naming conventions.
  ParameterTypeEnum

As can be seen, though some ParameterType enum values seem to follow some naming convention such as those HVAC ones, it is not consistent, and worse, most of others don’t follow anything. We are going to double confirm this fact with some code. Here we go:

        public static Dictionary<string, List<ParameterType>> GroupParameterTypesOnDiscipline(RvtApplication app)
        {
            Dictionary<string, List<ParameterType>> disciplineToParameterTypes = new Dictionary<string, List<ParameterType>>();

            string oriFile = app.SharedParametersFilename;
            string tempFile = Path.GetTempFileName() + ".txt";
            try
            {
                using (File.Create(tempFile)) { }
                app.SharedParametersFilename = tempFile;

                Definitions tempDefinitions = app.OpenSharedParameterFile().Groups.Create("TemporaryDefintionGroup").Definitions;
                foreach (ParameterType pt in Enum.GetValues(typeof(ParameterType)))
                {
                    if (pt != ParameterType.Invalid)
                    {
                        Definition def = tempDefinitions.Create(pt.ToString(), pt);
                        UnitGroup ug = UnitUtils.GetUnitGroup(def.UnitType);
                        if (disciplineToParameterTypes.ContainsKey(ug.ToString()))
                        {
                            disciplineToParameterTypes[ug.ToString()].Add(pt);
                        }
                        else
                        {
                            disciplineToParameterTypes.Add(ug.ToString(), new List<ParameterType> { pt });
                        }
                    }
                }

                File.Delete(tempFile);
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.ToString(), "GroupParameterTypesOnDiscipline");
            }
            finally
            {
                app.SharedParametersFilename = oriFile;
            }

            return disciplineToParameterTypes;
        }

        public static void PrintOutToDebug(Dictionary<string, List<ParameterType>> targetObj)
        {
            string info = "";
            foreach (KeyValuePair<string, List<ParameterType>> kvp in targetObj)
            {
                info += string.Format("{0}" + Environment.NewLine,  kvp.Key);
                foreach (ParameterType pt in kvp.Value)
                {
                    string label = pt.ToString();
                    try
                    {
                        label = LabelUtils.GetLabelFor(pt);
                    }
                    catch
                    {
                        System.Diagnostics.Debug.WriteLine(string.Format("{0} doesn't have a label?!", pt));
                    }

                    info += string.Format("\t{0}  ||  {1}" + Environment.NewLine, label, pt);
                }
            }

            System.Diagnostics.Debug.Write(info);
        }

If some caller code as follows is executed in Revit, we will get some output in the Visual Studio debug window.

SharedParameterRevitHelper.PrintOutToDebug(SharedParameterRevitHelper.GroupParameterTypesOnDiscipline(CachedApp));

FamilyType doesn't have a label?!
Common
    Text  ||  Text
    Integer  ||  Integer
    Number  ||  Number
    Length  ||  Length
    Area  ||  Area
    Volume  ||  Volume
    Angle  ||  Angle
    URL  ||  URL
    Material  ||  Material
    Yes/No  ||  YesNo
    Number of Poles  ||  NumberOfPoles
    Fixture Units  ||  FixtureUnit
    FamilyType  ||  FamilyType
    Load Classification  ||  LoadClassification
    Slope  ||  Slope
    Currency  ||  Currency
    Mass Density  ||  MassDensity
Structural
    Force  ||  Force
    Linear Force  ||  LinearForce
    Area Force  ||  AreaForce
    Moment  ||  Moment
    Stress  ||  Stress
    Unit Weight  ||  UnitWeight
    Thermal Expansion Coefficient  ||  ThermalExpansion
    Linear Moment  ||  LinearMoment
    Point Spring Coefficient  ||  ForcePerLength
    Rotational Point Spring Coefficient  ||  ForceLengthPerAngle
    Line Spring Coefficient  ||  LinearForcePerLength
    Rotational Line Spring Coefficient  ||  LinearForceLengthPerAngle
    Area Spring Coefficient  ||  AreaForcePerLength
    Reinforcement Volume  ||  ReinforcementVolume
    Reinforcement Length  ||  ReinforcementLength
    Acceleration  ||  Acceleration
    Bar Diameter  ||  BarDiameter
    Crack Width  ||  CrackWidth
    Displacement/Deflection  ||  DisplacementDeflection
    Energy  ||  Energy
    Frequency  ||  StructuralFrequency
    Mass  ||  Mass
    Mass per Unit Length  ||  MassPerUnitLength
    Moment of Inertia  ||  MomentOfInertia
    Surface Area per Unit Length  ||  SurfaceArea
    Period  ||  Period
    Pulsation  ||  Pulsation
    Reinforcement Area  ||  ReinforcementArea
    Reinforcement Area per Unit Length  ||  ReinforcementAreaPerUnitLength
    Reinforcement Cover  ||  ReinforcementCover
    Reinforcement Spacing  ||  ReinforcementSpacing
    Rotation  ||  Rotation
    Section Area  ||  SectionArea
    Section Dimension  ||  SectionDimension
    Section Modulus  ||  SectionModulus
    Section Property  ||  SectionProperty
    Velocity  ||  StructuralVelocity
    Warping Constant  ||  WarpingConstant
    Weight  ||  Weight
    Weight per Unit Length  ||  WeightPerUnitLength
    Mass per Unit Area  ||  MassPerUnitArea
HVAC
    Density  ||  HVACDensity
    Friction  ||  HVACFriction
    Power  ||  HVACPower
    Power Density  ||  HVACPowerDensity
    Pressure  ||  HVACPressure
    Temperature  ||  HVACTemperature
    Velocity  ||  HVACVelocity
    Air Flow  ||  HVACAirflow
    Duct Size  ||  HVACDuctSize
    Cross Section  ||  HVACCrossSection
    Heat Gain  ||  HVACHeatGain
    Roughness  ||  HVACRoughness
    Viscosity  ||  HVACViscosity
    Air Flow Density  ||  HVACAirflowDensity
    Cooling Load  ||  HVACCoolingLoad
    Cooling Load divided by Area  ||  HVACCoolingLoadDividedByArea
    Cooling Load divided by Volume  ||  HVACCoolingLoadDividedByVolume
    Heating Load  ||  HVACHeatingLoad
    Heating Load divided by Area  ||  HVACHeatingLoadDividedByArea
    Heating Load divided by Volume  ||  HVACHeatingLoadDividedByVolume
    Air Flow divided by Volume  ||  HVACAirflowDividedByVolume
    Air Flow divided by Cooling Load  ||  HVACAirflowDividedByCoolingLoad
    Area divided by Cooling Load  ||  HVACAreaDividedByCoolingLoad
    Slope  ||  HVACSlope
    Area divided by Heating Load  ||  HVACAreaDividedByHeatingLoad
    Factor  ||  HVACFactor
    Duct Insulation Thickness  ||  HVACDuctInsulationThickness
    Duct Lining Thickness  ||  HVACDuctLiningThickness
Energy
    Energy  ||  HVACEnergy
    Coefficient of Heat Transfer  ||  HVACCoefficientOfHeatTransfer
    Thermal Resistance  ||  HVACThermalResistance
    Thermal Mass  ||  HVACThermalMass
    Thermal Conductivity  ||  HVACThermalConductivity
    Specific Heat  ||  HVACSpecificHeat
    Specific Heat of Vaporization  ||  HVACSpecificHeatOfVaporization
    Permeability  ||  HVACPermeability
Electrical
    Current  ||  ElectricalCurrent
    Electrical Potential  ||  ElectricalPotential
    Frequency  ||  ElectricalFrequency
    Illuminance  ||  ElectricalIlluminance
    Luminous Flux  ||  ElectricalLuminousFlux
    Power  ||  ElectricalPower
    Apparent Power  ||  ElectricalApparentPower
    Power Density  ||  ElectricalPowerDensity
    Wire Diameter  ||  WireSize
    Efficacy  ||  ElectricalEfficacy
    Wattage  ||  ElectricalWattage
    Color Temperature  ||  ColorTemperature
    Luminous Intensity  ||  ElectricalLuminousIntensity
    Luminance  ||  ElectricalLuminance
    Temperature  ||  ElectricalTemperature
    Cable Tray Size  ||  ElectricalCableTraySize
    Conduit Size  ||  ElectricalConduitSize
    Demand Factor  ||  ElectricalDemandFactor
    Electrical Resistivity  ||  ElectricalResistivity
Piping
    Density  ||  PipingDensity
    Flow  ||  PipingFlow
    Friction  ||  PipingFriction
    Pressure  ||  PipingPressure
    Temperature  ||  PipingTemperature
    Velocity  ||  PipingVelocity
    Viscosity  ||  PipingViscosity
    Pipe Size  ||  PipeSize
    Roughness  ||  PipingRoughness
    Volume  ||  PipingVolume
    Slope  ||  PipingSlope
    Pipe Insulation Thickness  ||  PipeInsulationThickness

As can be seen, those ParameterType enum values belonging to the Energy discipline also have the HVAC as prefix. The last ParameterType of the Piping discipline has ‘Pipe’ as prefix instead of ‘Piping’ for others. The ParameterType enum values of Common and Structural disciplines are all mixed together without any distinguishable hints.
So, we create temporary parameter Definition (ExternalDefiniton actually) for each ParameterType and retrieve the unit type information from it, then use pretty the same mechanism to group the ParameterType enum values as the old post introduced.

By the way, the Revit SharedParametersFilename should not be permanently overridden by any addin or code. That explains why we apply some code to switch between the original and the temporary shared parameter files. It is another good practise that we strongly recommend.

Also a side finding: the FamilyType ParameterType does not have a label at all!

Enjoy it!

If you find the advice and code useful, please kindly make a donation through clicking the right button from the following link:

Download RevitNetAddinWizardPro and/or Donate

Revit Shared Parameter Viewer

$
0
0

Revit shared parameter file is a text file but not so readable.  It has some syntaxes and codes that are not so straightforward such as the group numbers, disciplines, and categories.  To help view Revit shared parameters in a nice window, we created the Revit Shared Parameter Viewer (RvtSPFViewer.exe).

SampleUI
 
It can be downloaded below.

Revit Shared Parameter Organizer

Revit Shared Parameter Viewer – Build #0.5.5.0

$
0
0

Revit Shared Parameter Viewer (RvtSPFViewer.exe) has been improved. A new build #0.5.5.0 has been posted.

Revit Shared Parameter Organizer

The major enhancement is that each column (shared parameter field) such as Group, Name, Discipline, Type, Visible and even GUID can be sorted now. Here is an example of Revit shared parameters that are sorted based on the Shared Parameter Type:

RvtSPFViewer0.5.5_Sample

Enjoy!

Revit Shared Parameter Viewer – Build #0.5.7.0

$
0
0

Revit Shared Parameter Viewer (RvtSPFViewer.exe) has been enhanced further. A new build #0.5.7.0 has been posted.

Revit Shared Parameter Organizer

The major enhancements in this build are readable text (.PO.txt) and spreadsheet csv (.PO.csv) file format support.
UI

If the readable text (.PO.txt) file is opened in Notepad, all shared parameters will be readable and look very nice.
POtxt

If the spreadsheet csv (.PO.csv) file is opened in Excel, the shared parameters will look nice there as well.

POcsv

Create Shared Parameters with all Different Parameter Types Using Revit .NET API and C#

$
0
0

Here is the code:

        public static void CreateSampleSharedParameters(RvtApplication app)
        {
            Dictionary<string, List<ParameterType>> disciplineToParameterTypes = new Dictionary<string, List<ParameterType>>();

            string oriFile = app.SharedParametersFilename;
            string tempFile = @"c:\RevitSharedParametersSample1.txt";
            try
            {
                using (File.Create(tempFile)) { }

                app.SharedParametersFilename = tempFile;

                Definitions tempDefinitions = app.OpenSharedParameterFile().Groups.Create("SampleGroup1").Definitions;
                foreach (ParameterType v in Enum.GetValues(typeof(ParameterType)))
                {
                    if (v != ParameterType.Invalid)
                    {
                        ExternalDefinition def = (ExternalDefinition)tempDefinitions.Create(v.ToString(), v);
                    }
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.ToString(), "CreateSampleSharedParameters");
            }
            finally
            {
                app.SharedParametersFilename = oriFile;
            }

        }

And Here is the result:

# This is a Revit shared parameter file.
# Do not edit manually.
*META    VERSION    MINVERSION
META    2    1
*GROUP    ID    NAME
GROUP    1    SampleGroup1
*PARAM    GUID    NAME    DATATYPE    DATACATEGORY    GROUP    VISIBLE
PARAM    45162401-eed0-45fb-b2cf-127b767e01a3    WireSize    WIRE_SIZE        1    1
PARAM    8c4d6f02-a06f-4562-90d8-6e234b0a5d00    PipingViscosity    PIPING_VISCOSITY        1    1
PARAM    b347d903-d5b7-4d55-9bbb-c5f6b587e861    ElectricalLuminousFlux    ELECTRICAL_LUMINOUS_FLUX        1    1
PARAM    5d340208-0f1a-4b8f-9723-3770c9cc23c7    PipingVelocity    PIPING_VELOCITY        1    1
PARAM    25cb9409-fc1f-42d8-894d-d696bc799e7d    ReinforcementVolume    REINFORCEMENT_VOLUME        1    1
PARAM    9d91380c-c6f3-4c81-accb-06a81b8dca9b    BarDiameter    BAR_DIAMETER        1    1
PARAM    03ce9e0e-d9b8-40ff-8d57-f3e17d082535    HVACHeatGain    HVAC_HEAT_GAIN        1    1
PARAM    12a8d00e-ddf7-4758-8f57-3f89b33267dd    HVACCoefficientOfHeatTransfer    HVAC_COEFFICIENT_OF_HEAT_TRANSFER        1    1
PARAM    4cce7c0f-2edb-4222-a033-502d8105eed8    HVACTemperature    HVAC_TEMPERATURE        1    1
PARAM    ccab6d15-106f-46d3-8514-b62975a4b061    PipingVolume    PIPING_VOLUME        1    1
PARAM    bea6fd16-7e47-4ef4-9b56-76c58d0705a3    WarpingConstant    WARPING_CONSTANT        1    1
PARAM    abe41217-d1e9-4fe0-9ca7-b6ec7908c373    HVACAreaDividedByHeatingLoad    HVAC_AREA_DIVIDED_BY_HEATING_LOAD        1    1
PARAM    0c38ae17-23cb-4672-81a4-0a2ff612131d    SectionProperty    SECTION_PROPERTY        1    1
PARAM    8ae4301b-045e-4788-bfaa-c9195d58fa04    Currency    CURRENCY        1    1
PARAM    7775e01d-7991-470f-ad3a-fccf3b3a0f0f    ElectricalPotential    ELECTRICAL_POTENTIAL        1    1
PARAM    a175dc24-4d75-4399-8259-fe7b93b60176    ReinforcementAreaPerUnitLength    REINFORCEMENT_AREA_PER_UNIT_LENGTH        1    1
PARAM    3aec7f25-b972-4341-98be-c9841b0b4c0c    PipeSize    PIPE_SIZE        1    1
PARAM    d304502b-7f67-4c2d-a4fd-ec6a5a2ca033    HVACVelocity    HVAC_VELOCITY        1    1
PARAM    b4a7482e-9118-4595-b6a3-f021743d5885    ElectricalFrequency    ELECTRICAL_FREQUENCY        1    1
PARAM    6b68b631-60cd-4bdc-b593-9ebf5d99e408    Text    TEXT        1    1
PARAM    5c1f5533-6aba-4cc0-854c-87aa47ecf580    HVACPressure    HVAC_PRESSURE        1    1
PARAM    203a8f36-68a3-4646-81b8-06f590cb4a51    MassDensity    MASS_DENSITY        1    1
PARAM    72436737-a62a-4a0d-a321-7233ea6d83b8    HVACThermalConductivity    HVAC_THERMAL_CONDUCTIVITY        1    1
PARAM    037dfa38-8545-48c3-a10f-52987566eb4b    AreaForce    AREA_FORCE        1    1
PARAM    86b9e73a-efcb-4faf-98f4-8d1d1351d759    ElectricalIlluminance    ELECTRICAL_ILLUMINANCE        1    1
PARAM    d3ef7e3c-e045-4f79-ace8-982f304890cf    HVACFactor    HVAC_FACTOR        1    1
PARAM    55f75440-25a7-4b6c-bf3a-1dae31a46026    HVACViscosity    HVAC_VISCOSITY        1    1
PARAM    ba388c42-044f-4665-bd39-91e7fc1866ee    HVACThermalMass    HVAC_THERMAL_MASS        1    1
PARAM    b6746643-7d10-4210-a740-ed73d9c691ea    StructuralFrequency    STRUCTURAL_FREQUENCY        1    1
PARAM    9cb58046-cf99-40f3-9b9d-08af07265ae9    HVACCoolingLoad    HVAC_COOLING_LOAD        1    1
PARAM    70f5174d-1f0b-440c-ae63-d54617e05a52    Pulsation    PULSATION        1    1
PARAM    5e0aaf51-f238-4a48-ba78-af9590766733    ThermalExpansion    THERMAL_EXPANSION_COEFFICIENT        1    1
PARAM    0e3ee653-2965-4b4f-8b16-2277d060d5af    HVACCoolingLoadDividedByVolume    HVAC_COOLING_LOAD_DIVIDED_BY_VOLUME        1    1
PARAM    93dc4256-f092-4495-b8bf-768d4ef49cc4    PipeInsulationThickness    PIPE_INSUlATION_THICKNESS        1    1
PARAM    bb217457-7250-4d93-af3c-6811dc490504    Angle    ANGLE        1    1
PARAM    f9c79d5a-126d-4772-9087-cf091ff73552    HVACDuctInsulationThickness    HVAC_DUCT_INSULATION_THICKNESS        1    1
PARAM    9e2ec35a-fd8b-42a8-aa78-c5dca9c4ad84    LinearMoment    LINEAR_MOMENT        1    1
PARAM    b639fa5b-a5e3-4444-867d-70366a151086    URL    URL        1    1
PARAM    6513d45c-8e63-47f5-afff-2d74d49621bb    HVACAreaDividedByCoolingLoad    HVAC_AREA_DIVIDED_BY_COOLING_LOAD        1    1
PARAM    08a96e5e-9ff7-4743-b112-1c4c5fbbb2d7    Stress    STRESS        1    1
PARAM    4941e463-34dc-41f8-808f-282109ef8108    HVACSpecificHeat    HVAC_SPECIFIC_HEAT        1    1
PARAM    f1493165-a9f2-4fbb-b3e8-873e74071208    ElectricalPower    ELECTRICAL_POWER        1    1
PARAM    40ebde65-034f-40f6-b18d-a3cad1da1746    HVACAirflowDensity    HVAC_AIRFLOW_DENSITY        1    1
PARAM    4e12ef66-5006-4ee3-b8df-067d6c83282e    ElectricalApparentPower    ELECTRICAL_APPARENT_POWER        1    1
PARAM    a4fb8269-8ed4-443a-99f2-03bb460db483    MassPerUnitArea    MASS_PER_UNIT_AREA        1    1
PARAM    9da75f6b-f2f2-4aa6-995b-a051ca000af7    Length    LENGTH        1    1
PARAM    39288e6b-6f99-4fe7-8ff2-129607edd909    HVACAirflowDividedByCoolingLoad    HVAC_AIRFLOW_DIVIDED_BY_COOLING_LOAD        1    1
PARAM    217e506e-c82a-4e14-b648-0dc76ccaac45    MassPerUnitLength    MASS_PER_UNIT_LENGTH        1    1
PARAM    8ff8aa6e-8e2f-4774-92ab-7963ba1b098d    Mass    MASS        1    1
PARAM    990e746f-3893-4836-bbce-2594354f5eba    Force    FORCE        1    1
PARAM    c79e7971-7702-4551-a005-bd1e387e7a49    ReinforcementLength    REINFORCEMENT_LENGTH        1    1
PARAM    b7e15a74-ed85-46a3-a6fb-807f1a498c31    HVACPower    HVAC_POWER        1    1
PARAM    d3759376-2321-4dce-b29f-ecdfdbed7c2b    HVACSlope    HVAC_SLOPE        1    1
PARAM    d0aad577-5beb-4116-a240-44666cf48538    WeightPerUnitLength    WEIGHT_PER_UNIT_LENGTH        1    1
PARAM    72057e7b-78dd-4501-be0f-2d2cd2229502    HVACHeatingLoadDividedByArea    HVAC_HEATING_LOAD_DIVIDED_BY_AREA        1    1
PARAM    0c36c47d-ff14-4628-82e6-a834583a3065    Moment    MOMENT        1    1
PARAM    602ee67e-466b-4ff9-afd7-8af00bc1a8f5    SurfaceArea    SURFACE_AREA        1    1
PARAM    8bb5987f-f3aa-4d18-b950-da2e267789f1    HVACCoolingLoadDividedByArea    HVAC_COOLING_LOAD_DIVIDED_BY_AREA        1    1
PARAM    a4363285-6602-4813-914d-3c201cf3d745    ForcePerLength    POINT_SPRING_COEFFICIENT        1    1
PARAM    b37b358a-5042-47bc-99f3-7ee51e2e5799    HVACHeatingLoad    HVAC_HEATING_LOAD        1    1
PARAM    2925e58d-6fd8-4b6a-931d-91191445142a    HVACRoughness    HVAC_ROUGHNESS        1    1
PARAM    50d92390-01b0-4971-ae7a-bcca8dc70b9e    HVACDuctLiningThickness    HVAC_DUCT_LINING_THICKNESS        1    1
PARAM    4eed3a93-6e5c-4bd3-bbf1-deb76c66f26e    HVACSpecificHeatOfVaporization    HVAC_SPECIFIC_HEAT_OF_VAPORIZATION        1    1
PARAM    8d18a195-597f-4b05-b22c-4a6e20130904    AreaForcePerLength    AREA_SPRING_COEFFICIENT        1    1
PARAM    cc52ef97-6691-45db-a65b-ad588eeba97d    HVACEnergy    HVAC_ENERGY        1    1
PARAM    fc9a8899-bdc5-48b9-b49a-6ec4d0b365bc    HVACDuctSize    HVAC_DUCT_SIZE        1    1
PARAM    e2858e99-ff98-41f7-ada1-6c5816180324    CrackWidth    CRACK_WIDTH        1    1
PARAM    333bf39a-4268-4581-83b1-2a18fb4488ef    ElectricalPowerDensity    ELECTRICAL_POWER_DENSITY        1    1
PARAM    551c699c-833d-4968-bf9b-f0d4e57c4ae8    PipingTemperature    PIPING_TEMPERATURE        1    1
PARAM    63d0d49d-9ee9-433e-a4f0-84697ebd438e    StructuralVelocity    VELOCITY        1    1
PARAM    a1c42a9e-76ca-4c46-8978-e11a06eea8bf    HVACPowerDensity    HVAC_POWER_DENSITY        1    1
PARAM    762d549e-2801-467d-b45d-c8ee1e837c23    ReinforcementCover    REINFORCEMENT_COVER        1    1
PARAM    434576a1-c8ee-4080-a66d-17956920be4f    Slope    SLOPE        1    1
PARAM    2a0d04a3-d6f4-40c8-8c44-a606c301472b    ElectricalCurrent    ELECTRICAL_CURRENT        1    1
PARAM    3b2507a3-b10e-4a7d-8ac0-b48ef9deaf53    UnitWeight    UNIT_WEIGHT        1    1
PARAM    89d490a3-2620-4479-b3ea-8eccacf96849    SectionModulus    SECTION_MODULUS        1    1
PARAM    582508a6-e5fd-49be-ade2-0d4ace5c0b74    LinearForceLengthPerAngle    ROTATIONAL_LINEAR_SPRING_COEFFICIENT        1    1
PARAM    82cf78ac-7455-43ee-be38-260a98be8696    ElectricalEfficacy    ELECTRICAL_EFFICACY        1    1
PARAM    d04271b1-d01f-47e2-906e-897b58292b27    Integer    INTEGER        1    1
PARAM    fc2892b1-6e2f-4a58-af75-a6be3aecb33d    HVACCrossSection    HVAC_CROSS_SECTION        1    1
PARAM    6a79c4b4-d135-48e6-84ed-a5654ff2e065    SectionDimension    SECTION_DIMENSION        1    1
PARAM    8cf913b5-009c-4476-8c2c-969073179943    FamilyType    FAMILYTYPE    -1    1    1
PARAM    714204b9-390b-40ec-ad6f-45d37445e40f    LoadClassification    LOADCLASSIFICATION        1    1
PARAM    9409c9b9-9e62-4d4d-908a-faca4532507e    ElectricalResistivity    ELECTRICAL_RESISTIVITY        1    1
PARAM    388c1fbc-9300-4d7f-bca5-db3fd786d2db    HVACAirflow    HVAC_AIR_FLOW        1    1
PARAM    6b9471bd-0398-401d-b1e9-4eae70cb9805    ElectricalDemandFactor    ELECTRICAL_DEMAND_FACTOR        1    1
PARAM    03e886bd-e926-46c6-a79d-32f4da5776a5    NumberOfPoles    NOOFPOLES        1    1
PARAM    1dbbf9be-9e58-408d-a94c-aaf6a65de315    ElectricalCableTraySize    CABLETRAY_SIZE        1    1
PARAM    561efdbe-a3c3-45da-9aa0-74ff7fee2d78    LinearForcePerLength    LINEAR_SPRING_COEFFICIENT        1    1
PARAM    2635ffc2-d0e5-451e-98ed-6a607a29497f    HVACThermalResistance    HVAC_THERMAL_RESISTANCE        1    1
PARAM    55b381c7-cefc-42c6-a884-be907413eab0    Period    PERIOD        1    1
PARAM    4a77bec7-39ef-4ce2-96fb-c5efabb0d685    HVACHeatingLoadDividedByVolume    HVAC_HEATING_LOAD_DIVIDED_BY_VOLUME        1    1
PARAM    b18448c8-f072-49bd-9ff1-4204a8dd78ac    HVACDensity    HVAC_DENSITY        1    1
PARAM    b1c411ca-d3d6-4a23-8bd9-1f9d69173057    ElectricalTemperature    ELECTRICAL_TEMPERATURE        1    1
PARAM    4a1d45cc-784f-4828-a92f-7c27a035889a    PipingSlope    PIPING_SLOPE        1    1
PARAM    bd3966d0-9b1d-448d-9d80-1b16ef133143    ReinforcementSpacing    REINFORCEMENT_SPACING        1    1
PARAM    4a134fd3-5360-4d5b-a391-51380de86afe    Area    AREA        1    1
PARAM    80e085d4-3c34-4f8c-a846-a005123d13aa    ReinforcementArea    REINFORCEMENT_AREA        1    1
PARAM    cef9f4d6-28eb-4afc-868d-a11f5685f26b    ElectricalLuminance    ELECTRICAL_LUMINANCE        1    1
PARAM    fafba7d7-f89b-455d-83e7-23d1d90df0e5    ColorTemperature    COLOR_TEMPERATURE        1    1
PARAM    4a2a1dd8-3afc-431b-8ae9-a9c11f7e2d3e    ElectricalConduitSize    CONDUIT_SIZE        1    1
PARAM    7ae90ad9-4a61-42e3-8aed-6af2bf51969c    Acceleration    ACCELERATION        1    1
PARAM    0006f4dc-af51-4fb5-8dcd-a3ea1d3337b1    HVACAirflowDividedByVolume    HVAC_AIRFLOW_DIVIDED_BY_VOLUME        1    1
PARAM    8b176edd-a4ca-4c8d-989a-eb4d00a5cba4    LinearForce    LINEAR_FORCE        1    1
PARAM    c1b8cfdd-7001-41fe-9493-b5bf056c4301    ElectricalLuminousIntensity    ELECTRICAL_LUMINOUS_INTENSITY        1    1
PARAM    49ea47de-1f45-4669-b055-f56a5543ec29    PipingFriction    PIPING_FRICTION        1    1
PARAM    67efaae4-7e22-44ce-82d3-122b8e4943a0    Volume    VOLUME        1    1
PARAM    23054ce7-8a6d-4bd6-bddf-33c8e83c2e84    YesNo    YESNO        1    1
PARAM    b97e2ae8-bd38-49e3-850a-b5e54a252a03    MomentOfInertia    MOMENT_OF_INERTIA        1    1
PARAM    35b145e8-537b-42ca-94bc-1ba7669ca81e    SectionArea    SECTION_AREA        1    1
PARAM    729ca5e9-6c74-4d03-8723-600802bad190    Rotation    ROTATION        1    1
PARAM    f6b745ea-89f4-4f31-a6e0-6bc7ee656d4e    HVACFriction    HVAC_FRICTION        1    1
PARAM    a3a8aaea-9242-4e34-8196-4420d8e3149c    PipingRoughness    PIPING_ROUGHNESS        1    1
PARAM    d34b3ded-e244-45ee-862f-9036d131af4a    Number    NUMBER        1    1
PARAM    ee9f1def-d896-41a5-9fd5-18ab39515dc7    DisplacementDeflection    DISPLACEMENT/DEFLECTION        1    1
PARAM    a1ca32ef-76cd-466d-a289-651153532966    PipingPressure    PIPING_PRESSURE        1    1
PARAM    a7a027f0-fc60-4a6d-8b75-7844d46a3a1b    ElectricalWattage    ELECTRICAL_WATTAGE        1    1
PARAM    282891f0-b2fd-49ec-a2f0-ba737b3f82b4    Material    MATERIAL        1    1
PARAM    732dd0f0-d375-495f-9179-2769ee3325c2    HVACPermeability    HVAC_PERMEABILITY        1    1
PARAM    544666f2-07b8-4b42-97cb-ad498cb4dcb6    Energy    ENERGY        1    1
PARAM    cf616af6-2d56-42d2-afa1-d15afa195604    ForceLengthPerAngle    ROTATIONAL_POINT_SPRING_COEFFICIENT        1    1
PARAM    c084a2f7-1793-4eea-8efd-7b9514a99a62    Weight    WEIGHT        1    1
PARAM    ef71aef9-d0a0-4af6-9b70-37aa02180372    FixtureUnit    FIXTUREUNIT        1    1
PARAM    6db023fc-ffb6-47f0-b118-658fffe3a3c2    PipingDensity    PIPING_DENSITY        1    1
PARAM    17c5dbfd-9921-4f13-998f-9f87fea25c1a    PipingFlow    PIPING_FLOW        1    1

Visual Smarter provides many Document Widgets in the recent build #0.7.8.0.


Revit .NET API: Categorize Revit Categories (pt. 1) - Based on CategoryType

$
0
0

Besides those important parameters, built-in or custom, project or family, modifiable or read-only, Revit also has many categories, which can be categorized or grouped further based on different criteria or purposes.

In this post, let’s categorize Revit Categories based on the CategoryType that the Category object itself carries on.

        public static Dictionary<CategoryType, List<Category>> CategorizeCategories1(RvtDocument doc)
        {
            string tempFile = @"c:\temp\CategorizedCategories1.txt";
            Dictionary<CategoryType, List<Category>> ret = new Dictionary<CategoryType, List<Category>>();

            try
            {
                foreach (Category c in doc.Settings.Categories)
                {
                    if ( c.Id.IntegerValue != (int)BuiltInCategory.INVALID)
                    {
                        if (!ret.ContainsKey(c.CategoryType))
                            ret.Add(c.CategoryType, new List<Category>());

                        ret[c.CategoryType].Add(c);
                    }
                }

                using (StreamWriter sw = new StreamWriter(tempFile))
                {
                    foreach(KeyValuePair<CategoryType, List<Category>> kvp in ret)
                    {
                        sw.WriteLine(kvp.Key.ToString());
                        foreach(Category c in kvp.Value)
                        {
                            sw.WriteLine(string.Format("\t{0}", c.Name));
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.ToString());
            }

            return ret;
        }

The output may be as follows:

Annotation
    Part Tags
    Pipe Insulation Tags
    Mechanical Equipment Tags
    Foundation Span Direction Symbol
    Communication Device Tags
    Analytical Wall Tags
    Ceiling Tags
    Furniture Tags
    Pipe Accessory Tags
    Security Device Tags
    Window Tags
    Stair Tread/Riser Numbers
    Panel Schedule Graphics
    Detail Item Tags
    Reference Lines
    Structural Framing Tags
    Section Boxes
    Elevation Marks
    Data Device Tags
    Lighting Fixture Tags
    Assembly Tags
    Duct Tags
    Structural Rebar Tags
    Door Tags
    Internal Area Load Tags
    Revision Clouds
    Multi-Category Tags
    Property Line Segment Tags
    Curtain Panel Tags
    Mass Floor Tags
    Zone Tags
    Reference Planes
    Cable Tray Tags
    Multi-Rebar Annotations
    Matchline
    Specialty Equipment Tags
    Duct Fitting Tags
    Furniture System Tags
    Callout Heads
    Structural Stiffener Tags
    Casework Tags
    Wall Tags
    Cable Tray Fitting Tags
    Duct Insulation Tags
    Rebar Cover References
    Stair Support Tags
    Structural Truss Tags
    Analytical Slab Foundation Tags
    Plan Region
    Air Terminal Tags
    Structural Annotations
    Span Direction Symbol
    Section Line
    Section Marks
    Pipe Color Fill
    Lighting Device Tags
    Floor Tags
    Sprinkler Tags
    Scope Boxes
    Line Load Tags
    Render Regions
    Structural Path Reinforcement Symbols
    Stair Landing Tags
    Displacement Path
    Duct Lining Tags
    Flex Duct Tags
    Analytical Wall Foundation Tags
    Structural Area Reinforcement Tags
    Stair Run Tags
    Nurse Call Device Tags
    Area Load Tags
    Generic Annotations
    Area Tags
    View Reference
    Analytical Column Tags
    Connection Symbols
    Conduit Fitting Tags
    Structural Column Tags
    Analytical Beam Tags
    Adaptive Points
    Fabrication Part Tags
    Grid Heads
    Sections
    Room Tags
    Stair Tags
    Revision Cloud Tags
    Duct Accessory Tags
    Spot Slopes
    Keynote Tags
    Space Tags
    Rebar Set Toggle
    Pipe Color Fill Legends
    Guide Grid
    Grids
    Fire Alarm Device Tags
    Planting Tags
    Callouts
    Schedule Graphics
    Electrical Fixture Tags
    Telephone Device Tags
    Curtain System Tags
    Internal Line Load Tags
    Structural Fabric Reinforcement Symbols
    Mass Tags
    Analytical Node Tags
    Property Tags
    Structural Path Reinforcement Tags
    Callout Boundary
    Structural Area Reinforcement Symbols
    Contour Labels
    Reference Points
    Spot Elevation Symbols
    Internal Point Load Tags
    Analytical Isolated Foundation Tags
    Flex Pipe Tags
    Cameras
    Elevations
    Analytical Floor Tags
    Structural Connection Tags
    Level Heads
    Duct Color Fill Legends
    Levels
    Brace in Plan View Symbols
    Railing Tags
    Structural Foundation Tags
    Wire Tags
    Site Tags
    Pipe Tags
    Analytical Link Tags
    Spot Coordinates
    Viewports
    Title Blocks
    Plumbing Fixture Tags
    Pipe Fitting Tags
    Duct Color Fill
    Stair Paths
    Roof Tags
    Conduit Tags
    Point Load Tags
    Structural Fabric Reinforcement Tags
    Material Tags
    View Titles
    Parking Tags
    Structural Beam System Tags
    Analytical Brace Tags
    Electrical Equipment Tags
    Generic Model Tags
    Text Notes
    Spot Elevations
    Color Fill Legends
    Dimensions
AnalyticalModel
    Analytical Floors
    Analytical Wall Foundations
    Analytical Spaces
    Analytical Isolated Foundations
    Analytical Links
    Analytical Columns
    Structural Internal Loads
    Structural Load Cases
    Analytical Braces
    Analytical Foundation Slabs
    Structural Loads
    Analytical Beams
    Analytical Surfaces
    Analytical Walls
    Analytical Nodes
    Boundary Conditions
Model
    Ramps
    Cable Tray Fittings
    Structural Connections
    Planting
    Mass
    Air Terminals
    Communication Devices
    Piping Systems
    Plumbing Fixtures
    Ceilings
    Pipe Segments
    Conduit Fittings
    Sprinklers
    Doors
    Lighting Devices
    Curtain Systems
    Parking
    Ducts
    Imports in Families
    Conduits
    Flex Pipes
    Structural Trusses
    HVAC Zones
    Site
    Duct Systems
    Duct Placeholders
    Duct Accessories
    Furniture Systems
    Telephone Devices
    Lines
    Wires
    Pipes
    Topography
    Project Information
    Fabrication Parts
    Analysis Display Style
    Pipe Insulations
    Flex Ducts
    Structural Area Reinforcement
    Structural Framing
    Electrical Fixtures
    Data Devices
    Lighting Fixtures
    Duct Insulations
    Cable Tray Runs
    Generic Models
    Analysis Results
    Electrical Equipment
    Curtain Panels
    Fire Alarm Devices
    Roads
    Floors
    Point Clouds
    Windows
    Structural Path Reinforcement
    Rebar Shape
    Parts
    Columns
    Routing Preferences
    Filled region
    Structural Fabric Reinforcement
    Raster Images
    Curtain Wall Mullions
    Walls
    Conduit Runs
    Pipe Fittings
    Structural Columns
    Pipe Placeholders
    Cable Trays
    Structural Stiffeners
    Entourage
    Nurse Call Devices
    Areas
    Materials
    Roofs
    Structural Fabric Areas
    Structural Rebar
    Shaft Openings
    Duct Fittings
    Specialty Equipment
    Pipe Accessories
    Masking Region
    Structural Foundations
    Curtain Grids
    Security Devices
    Railings
    Duct Linings
    Structural Beam Systems
    Sheets
    Casework
    Mechanical Equipment
    Switch System
    Furniture
    Rooms
    Stairs
    Detail Items
    Spaces
Internal
    Assemblies
    Structural Connection Handlers
    Views

Enjoy!

If you find the article, the code, or the wizards/widgets/coders useful, please kindly make a donation through clicking the right button from the following link:

Download RevitNetAddinWizardPro and/or Donate

Revit .NET API: Categorize Revit Categories (pt. 2) - Based on AllowsBoundParameters

$
0
0

Besides those important parameters, built-in or custom, project or family, modifiable or read-only, Revit also has many categories, which can be categorized or grouped further based on different criteria or purposes.

In this post, let’s categorize Revit Categories based on the AllowsBoundParameters that the Category object itself carries on.

        public static Dictionary<string, List<Category>> CategorizeCategories2(RvtDocument doc)
        {
            string tempFile = @"c:\temp\CategorizedCategories2.txt";
            Dictionary<string, List<Category>> ret = new Dictionary<string, List<Category>>();
            ret.Add("AllowsBoundParameters", new List<Category>());
            ret.Add("NOT AllowsBoundParameters", new List<Category>());
            try
            {
                foreach (Category c in doc.Settings.Categories)
                {
                    if (c.Id.IntegerValue != (int)BuiltInCategory.INVALID)
                    {
                        if (c.AllowsBoundParameters == true)
                            ret.First().Value.Add(c);
                        else
                            ret.Last().Value.Add(c);
                    }
                }
                List<Category> sorted = ret.First().Value.OrderBy(f => f.Name).ToList();
                ret.First().Value.Clear();
                ret.First().Value.AddRange(sorted);
                using (StreamWriter sw = new StreamWriter(tempFile))
                {
                    foreach (KeyValuePair<string, List<Category>> kvp in ret)
                    {
                        sw.WriteLine(kvp.Key.ToString());
                        foreach (Category c in kvp.Value)
                        {
                            sw.WriteLine(string.Format("\t{0}", c.Name));
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.ToString());
            }

            return ret;
        }

The output may be as follows:

AllowsBoundParameters
    Air Terminals
    Analytical Beams
    Analytical Braces
    Analytical Columns
    Analytical Floors
    Analytical Foundation Slabs
    Analytical Isolated Foundations
    Analytical Links
    Analytical Nodes
    Analytical Spaces
    Analytical Surfaces
    Analytical Wall Foundations
    Analytical Walls
    Areas
    Assemblies
    Cable Tray Fittings
    Cable Tray Runs
    Cable Trays
    Casework
    Ceilings
    Columns
    Communication Devices
    Conduit Fittings
    Conduit Runs
    Conduits
    Curtain Panels
    Curtain Systems
    Curtain Wall Mullions
    Data Devices
    Detail Items
    Doors
    Duct Accessories
    Duct Fittings
    Duct Insulations
    Duct Linings
    Duct Placeholders
    Duct Systems
    Ducts
    Electrical Equipment
    Electrical Fixtures
    Entourage
    Fabrication Parts
    Fire Alarm Devices
    Flex Ducts
    Flex Pipes
    Floors
    Furniture
    Furniture Systems
    Generic Models
    Grids
    HVAC Zones
    Levels
    Lighting Devices
    Lighting Fixtures
    Mass
    Materials
    Mechanical Equipment
    Nurse Call Devices
    Parking
    Parts
    Pipe Accessories
    Pipe Fittings
    Pipe Insulations
    Pipe Placeholders
    Pipes
    Piping Systems
    Planting
    Plumbing Fixtures
    Project Information
    Railings
    Ramps
    Rebar Shape
    Roads
    Roofs
    Rooms
    Security Devices
    Shaft Openings
    Sheets
    Site
    Spaces
    Specialty Equipment
    Sprinklers
    Stairs
    Structural Area Reinforcement
    Structural Beam Systems
    Structural Columns
    Structural Connection Handlers
    Structural Connections
    Structural Fabric Areas
    Structural Fabric Reinforcement
    Structural Foundations
    Structural Framing
    Structural Path Reinforcement
    Structural Rebar
    Structural Stiffeners
    Structural Trusses
    Switch System
    Telephone Devices
    Topography
    Views
    Walls
    Windows
    Wires
NOT AllowsBoundParameters
    Part Tags
    Pipe Insulation Tags
    Mechanical Equipment Tags
    Foundation Span Direction Symbol
    Communication Device Tags
    Analytical Wall Tags
    Ceiling Tags
    Furniture Tags
    Pipe Accessory Tags
    Security Device Tags
    Window Tags
    Stair Tread/Riser Numbers
    Panel Schedule Graphics
    Detail Item Tags
    Reference Lines
    Structural Framing Tags
    Section Boxes
    Elevation Marks
    Data Device Tags
    Pipe Segments
    Lighting Fixture Tags
    Assembly Tags
    Duct Tags
    Structural Rebar Tags
    Door Tags
    Internal Area Load Tags
    Revision Clouds
    Imports in Families
    Multi-Category Tags
    Property Line Segment Tags
    Curtain Panel Tags
    Mass Floor Tags
    Zone Tags
    Reference Planes
    Cable Tray Tags
    Multi-Rebar Annotations
    Matchline
    Specialty Equipment Tags
    Duct Fitting Tags
    Furniture System Tags
    Callout Heads
    Lines
    Structural Stiffener Tags
    Casework Tags
    Wall Tags
    Cable Tray Fitting Tags
    Structural Internal Loads
    Analysis Display Style
    Duct Insulation Tags
    Rebar Cover References
    Structural Load Cases
    Stair Support Tags
    Structural Truss Tags
    Analytical Slab Foundation Tags
    Plan Region
    Air Terminal Tags
    Structural Annotations
    Span Direction Symbol
    Section Line
    Section Marks
    Pipe Color Fill
    Lighting Device Tags
    Floor Tags
    Sprinkler Tags
    Analysis Results
    Scope Boxes
    Line Load Tags
    Render Regions
    Structural Path Reinforcement Symbols
    Stair Landing Tags
    Displacement Path
    Duct Lining Tags
    Flex Duct Tags
    Point Clouds
    Analytical Wall Foundation Tags
    Structural Area Reinforcement Tags
    Stair Run Tags
    Nurse Call Device Tags
    Area Load Tags
    Routing Preferences
    Generic Annotations
    Area Tags
    View Reference
    Filled region
    Analytical Column Tags
    Connection Symbols
    Conduit Fitting Tags
    Raster Images
    Structural Column Tags
    Analytical Beam Tags
    Adaptive Points
    Fabrication Part Tags
    Grid Heads
    Sections
    Room Tags
    Stair Tags
    Structural Loads
    Revision Cloud Tags
    Duct Accessory Tags
    Spot Slopes
    Keynote Tags
    Space Tags
    Rebar Set Toggle
    Pipe Color Fill Legends
    Guide Grid
    Fire Alarm Device Tags
    Planting Tags
    Callouts
    Schedule Graphics
    Electrical Fixture Tags
    Telephone Device Tags
    Curtain System Tags
    Internal Line Load Tags
    Structural Fabric Reinforcement Symbols
    Mass Tags
    Analytical Node Tags
    Property Tags
    Structural Path Reinforcement Tags
    Callout Boundary
    Structural Area Reinforcement Symbols
    Contour Labels
    Reference Points
    Spot Elevation Symbols
    Internal Point Load Tags
    Analytical Isolated Foundation Tags
    Flex Pipe Tags
    Cameras
    Elevations
    Analytical Floor Tags
    Structural Connection Tags
    Masking Region
    Level Heads
    Duct Color Fill Legends
    Curtain Grids
    Brace in Plan View Symbols
    Railing Tags
    Structural Foundation Tags
    Wire Tags
    Site Tags
    Pipe Tags
    Analytical Link Tags
    Spot Coordinates
    Viewports
    Title Blocks
    Plumbing Fixture Tags
    Pipe Fitting Tags
    Duct Color Fill
    Stair Paths
    Roof Tags
    Conduit Tags
    Point Load Tags
    Structural Fabric Reinforcement Tags
    Material Tags
    View Titles
    Parking Tags
    Structural Beam System Tags
    Analytical Brace Tags
    Electrical Equipment Tags
    Generic Model Tags
    Text Notes
    Spot Elevations
    Boundary Conditions
    Color Fill Legends
    Dimensions

Enjoy!

If you find the article, the code, or the RevitNetAddinWizard(Pro) useful, please kindly make a donation through clicking the right button from the following link:

Download RevitNetAddinWizardPro and/or Donate

Revit Shared Parameter Viewer – Build #0.6.0.0

$
0
0

Revit Shared Parameter Viewer (RvtSPFViewer.exe) has been enhanced further. A new build #0.6.0.0 has been posted.

Revit Shared Parameter Organizer

 The major enhancements in this build are the support for various parameter Data Types and the support for various Family Types (or Categories).

If a Revit shared parameter file contains various data types, all of them can be viewed in Revit Shared Parameter Viewer (RvtSPFViewer.exe) properly.

AllDataTypes

If a Revit shared parameter file contains various family types, all of them can also be viewed in this version of Revit Shared Parameter Viewer (RvtSPFViewer.exe) properly.

AllFamilyTypes

Revit .NET API: Categorize Revit Categories (pt. 3) - Based on CanAddSubcategory

$
0
0

Besides those important parameters, built-in or custom, project or family, modifiable or read-only, Revit also has many categories, which can be categorized or grouped further based on different criteria or purposes.

In this post, let’s categorize Revit Categories based on the CanAddSubcategory criteria that the Category object itself carries on.

        public static Dictionary<string, List<Category>> CategorizeCategories3(RvtDocument doc)
        {
            string tempFile = @"c:\temp\CategorizedCategories3.txt";
            Dictionary<string, List<Category>> ret = new Dictionary<string, List<Category>>();
            ret.Add("CanAddSubcategory", new List<Category>());
            ret.Add("NOT CanAddSubcategory", new List<Category>());
            try
            {
                foreach (Category c in doc.Settings.Categories)
                {
                    if (c.Id.IntegerValue != (int)BuiltInCategory.INVALID)
                    {
                        if (c.CanAddSubcategory == true)
                            ret.First().Value.Add(c);
                        else
                            ret.Last().Value.Add(c);
                    }
                }
                List<Category> sorted = ret.First().Value.OrderBy(f => f.Name).ToList();
                ret.First().Value.Clear();
                ret.First().Value.AddRange(sorted);
                using (StreamWriter sw = new StreamWriter(tempFile))
                {
                    foreach (KeyValuePair<string, List<Category>> kvp in ret)
                    {
                        sw.WriteLine(kvp.Key.ToString());
                        foreach (Category c in kvp.Value)
                        {
                            sw.WriteLine(string.Format("\t{0}", c.Name));
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.ToString());
            }

            return ret;
        }

The output may be as follows:

CanAddSubcategory
    Adaptive Points
    Air Terminal Tags
    Air Terminals
    Analytical Beam Tags
    Analytical Beams
    Analytical Brace Tags
    Analytical Braces
    Analytical Column Tags
    Analytical Columns
    Analytical Floor Tags
    Analytical Floors
    Analytical Foundation Slabs
    Analytical Isolated Foundation Tags
    Analytical Isolated Foundations
    Analytical Link Tags
    Analytical Links
    Analytical Node Tags
    Analytical Nodes
    Analytical Slab Foundation Tags
    Analytical Spaces
    Analytical Surfaces
    Analytical Wall Foundation Tags
    Analytical Wall Foundations
    Analytical Wall Tags
    Analytical Walls
    Area Load Tags
    Area Tags
    Assembly Tags
    Boundary Conditions
    Brace in Plan View Symbols
    Cable Tray Fitting Tags
    Cable Tray Fittings
    Cable Tray Tags
    Cable Trays
    Callout Boundary
    Callout Heads
    Casework
    Casework Tags
    Ceiling Tags
    Ceilings
    Columns
    Communication Device Tags
    Communication Devices
    Conduit Fitting Tags
    Conduit Fittings
    Conduit Tags
    Conduits
    Connection Symbols
    Curtain Panel Tags
    Curtain Panels
    Curtain System Tags
    Curtain Wall Mullions
    Data Device Tags
    Data Devices
    Detail Item Tags
    Detail Items
    Displacement Path
    Door Tags
    Doors
    Duct Accessories
    Duct Accessory Tags
    Duct Fitting Tags
    Duct Fittings
    Duct Insulation Tags
    Duct Insulations
    Duct Lining Tags
    Duct Linings
    Duct Placeholders
    Duct Tags
    Ducts
    Electrical Equipment
    Electrical Equipment Tags
    Electrical Fixture Tags
    Electrical Fixtures
    Elevation Marks
    Entourage
    Fabrication Part Tags
    Fabrication Parts
    Fire Alarm Device Tags
    Fire Alarm Devices
    Flex Duct Tags
    Flex Ducts
    Flex Pipe Tags
    Flex Pipes
    Floor Tags
    Floors
    Foundation Span Direction Symbol
    Furniture
    Furniture System Tags
    Furniture Systems
    Furniture Tags
    Generic Annotations
    Generic Model Tags
    Generic Models
    Grid Heads
    HVAC Zones
    Internal Area Load Tags
    Internal Line Load Tags
    Internal Point Load Tags
    Keynote Tags
    Level Heads
    Lighting Device Tags
    Lighting Devices
    Lighting Fixture Tags
    Lighting Fixtures
    Line Load Tags
    Lines
    Mass
    Mass Floor Tags
    Mass Tags
    Matchline
    Material Tags
    Mechanical Equipment
    Mechanical Equipment Tags
    Multi-Category Tags
    Nurse Call Device Tags
    Nurse Call Devices
    Parking
    Parking Tags
    Part Tags
    Parts
    Pipe Accessories
    Pipe Accessory Tags
    Pipe Fitting Tags
    Pipe Fittings
    Pipe Insulation Tags
    Pipe Insulations
    Pipe Placeholders
    Pipe Tags
    Pipes
    Plan Region
    Planting
    Planting Tags
    Plumbing Fixture Tags
    Plumbing Fixtures
    Point Load Tags
    Property Line Segment Tags
    Property Tags
    Railing Tags
    Railings
    Ramps
    Rebar Cover References
    Reference Points
    Revision Cloud Tags
    Revision Clouds
    Roads
    Roof Tags
    Roofs
    Room Tags
    Schedule Graphics
    Section Boxes
    Section Line
    Section Marks
    Security Device Tags
    Security Devices
    Shaft Openings
    Site
    Site Tags
    Space Tags
    Span Direction Symbol
    Specialty Equipment
    Specialty Equipment Tags
    Spot Elevation Symbols
    Sprinkler Tags
    Sprinklers
    Stair Landing Tags
    Stair Paths
    Stair Run Tags
    Stair Support Tags
    Stair Tags
    Stair Tread/Riser Numbers
    Stairs
    Structural Annotations
    Structural Area Reinforcement
    Structural Area Reinforcement Symbols
    Structural Area Reinforcement Tags
    Structural Beam System Tags
    Structural Beam Systems
    Structural Column Tags
    Structural Columns
    Structural Connection Tags
    Structural Connections
    Structural Fabric Areas
    Structural Fabric Reinforcement
    Structural Fabric Reinforcement Symbols
    Structural Fabric Reinforcement Tags
    Structural Foundation Tags
    Structural Foundations
    Structural Framing
    Structural Framing Tags
    Structural Load Cases
    Structural Path Reinforcement
    Structural Path Reinforcement Symbols
    Structural Path Reinforcement Tags
    Structural Rebar
    Structural Rebar Tags
    Structural Stiffener Tags
    Structural Stiffeners
    Structural Truss Tags
    Structural Trusses
    Telephone Device Tags
    Telephone Devices
    Title Blocks
    Topography
    View Reference
    View Titles
    Wall Tags
    Walls
    Window Tags
    Windows
    Wire Tags
    Wires
    Zone Tags
NOT CanAddSubcategory
    Piping Systems
    Panel Schedule Graphics
    Reference Lines
    Pipe Segments
    Curtain Systems
    Imports in Families
    Duct Systems
    Reference Planes
    Multi-Rebar Annotations
    Project Information
    Structural Internal Loads
    Analysis Display Style
    Assemblies
    Cable Tray Runs
    Pipe Color Fill
    Analysis Results
    Scope Boxes
    Render Regions
    Point Clouds
    Rebar Shape
    Routing Preferences
    Filled region
    Raster Images
    Sections
    Structural Loads
    Conduit Runs
    Spot Slopes
    Rebar Set Toggle
    Pipe Color Fill Legends
    Guide Grid
    Grids
    Callouts
    Contour Labels
    Areas
    Materials
    Cameras
    Elevations
    Masking Region
    Duct Color Fill Legends
    Curtain Grids
    Levels
    Structural Connection Handlers
    Spot Coordinates
    Viewports
    Duct Color Fill
    Views
    Sheets
    Switch System
    Rooms
    Text Notes
    Spot Elevations
    Color Fill Legends
    Spaces
    Dimensions

Enjoy!

If you find the article, the code, or the RevitNetAddinWizard(Pro) useful, please kindly make a donation through clicking the right button from the following link:

Download RevitNetAddinWizardPro and/or Donate

Revit .NET API: Categorize Revit Categories (pt. 4) - Based on HasMaterialQuantities

$
0
0

Besides those important parameters, built-in or custom, project or family, modifiable or read-only, Revit also has many categories, which can be categorized or grouped further based on different criteria or purposes.

In this post, let’s categorize Revit Categories based on the HasMaterialQuantities criteria that the Category object itself carries on.

        public static Dictionary<string, List<Category>> CategorizeCategories4(RvtDocument doc)
        {
            string tempFile = @"c:\temp\CategorizedCategories4.txt";
            Dictionary<string, List<Category>> ret = new Dictionary<string, List<Category>>();
            ret.Add("HasMaterialQuantities", new List<Category>());
            ret.Add("NOT HasMaterialQuantities", new List<Category>());
            try
            {
                foreach (Category c in doc.Settings.Categories)
                {
                    if (c.Id.IntegerValue != (int)BuiltInCategory.INVALID)
                    {
                        if (c.HasMaterialQuantities == true)
                            ret.First().Value.Add(c);
                        else
                            ret.Last().Value.Add(c);
                    }
                }
                List<Category> sorted = ret.First().Value.OrderBy(f => f.Name).ToList();
                ret.First().Value.Clear();
                ret.First().Value.AddRange(sorted);
                using (StreamWriter sw = new StreamWriter(tempFile))
                {
                    foreach (KeyValuePair<string, List<Category>> kvp in ret)
                    {
                        sw.WriteLine(kvp.Key.ToString());
                        foreach (Category c in kvp.Value)
                        {
                            sw.WriteLine(string.Format("\t{0}", c.Name));
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.ToString());
            }

            return ret;
        }

The output may be as follows:

HasMaterialQuantities
    Assemblies
    Casework
    Ceilings
    Columns
    Communication Devices
    Curtain Panels
    Data Devices
    Doors
    Electrical Equipment
    Electrical Fixtures
    Entourage
    Fire Alarm Devices
    Floors
    Furniture
    Furniture Systems
    Generic Models
    Lighting Devices
    Lighting Fixtures
    Mechanical Equipment
    Nurse Call Devices
    Parts
    Plumbing Fixtures
    Roofs
    Security Devices
    Site
    Specialty Equipment
    Sprinklers
    Stairs
    Structural Columns
    Structural Connections
    Structural Foundations
    Structural Framing
    Telephone Devices
    Walls
    Windows
NOT HasMaterialQuantities
    Part Tags
    Pipe Insulation Tags
    Analytical Floors
    Mechanical Equipment Tags
    Ramps
    Cable Tray Fittings
    Foundation Span Direction Symbol
    Communication Device Tags
    Analytical Wall Tags
    Planting
    Ceiling Tags
    Analytical Wall Foundations
    Furniture Tags
    Mass
    Air Terminals
    Pipe Accessory Tags
    Security Device Tags
    Window Tags
    Stair Tread/Riser Numbers
    Piping Systems
    Panel Schedule Graphics
    Detail Item Tags
    Reference Lines
    Analytical Spaces
    Structural Framing Tags
    Section Boxes
    Elevation Marks
    Data Device Tags
    Pipe Segments
    Conduit Fittings
    Lighting Fixture Tags
    Assembly Tags
    Duct Tags
    Curtain Systems
    Structural Rebar Tags
    Parking
    Ducts
    Door Tags
    Internal Area Load Tags
    Revision Clouds
    Imports in Families
    Conduits
    Multi-Category Tags
    Analytical Isolated Foundations
    Flex Pipes
    Property Line Segment Tags
    Curtain Panel Tags
    Analytical Links
    Structural Trusses
    HVAC Zones
    Mass Floor Tags
    Analytical Columns
    Duct Systems
    Zone Tags
    Duct Placeholders
    Reference Planes
    Cable Tray Tags
    Multi-Rebar Annotations
    Matchline
    Specialty Equipment Tags
    Duct Accessories
    Duct Fitting Tags
    Furniture System Tags
    Callout Heads
    Lines
    Wires
    Pipes
    Structural Stiffener Tags
    Topography
    Casework Tags
    Project Information
    Wall Tags
    Cable Tray Fitting Tags
    Fabrication Parts
    Structural Internal Loads
    Analysis Display Style
    Pipe Insulations
    Flex Ducts
    Duct Insulation Tags
    Rebar Cover References
    Structural Load Cases
    Stair Support Tags
    Structural Area Reinforcement
    Structural Truss Tags
    Analytical Slab Foundation Tags
    Plan Region
    Air Terminal Tags
    Structural Annotations
    Duct Insulations
    Span Direction Symbol
    Section Line
    Cable Tray Runs
    Section Marks
    Pipe Color Fill
    Lighting Device Tags
    Floor Tags
    Sprinkler Tags
    Analysis Results
    Scope Boxes
    Line Load Tags
    Render Regions
    Structural Path Reinforcement Symbols
    Stair Landing Tags
    Analytical Braces
    Displacement Path
    Roads
    Duct Lining Tags
    Flex Duct Tags
    Point Clouds
    Analytical Wall Foundation Tags
    Analytical Foundation Slabs
    Structural Area Reinforcement Tags
    Structural Path Reinforcement
    Stair Run Tags
    Rebar Shape
    Nurse Call Device Tags
    Area Load Tags
    Routing Preferences
    Generic Annotations
    Area Tags
    View Reference
    Filled region
    Analytical Column Tags
    Structural Fabric Reinforcement
    Connection Symbols
    Conduit Fitting Tags
    Raster Images
    Structural Column Tags
    Analytical Beam Tags
    Adaptive Points
    Fabrication Part Tags
    Grid Heads
    Sections
    Room Tags
    Curtain Wall Mullions
    Stair Tags
    Structural Loads
    Revision Cloud Tags
    Conduit Runs
    Duct Accessory Tags
    Spot Slopes
    Keynote Tags
    Space Tags
    Rebar Set Toggle
    Pipe Color Fill Legends
    Pipe Fittings
    Pipe Placeholders
    Guide Grid
    Grids
    Fire Alarm Device Tags
    Planting Tags
    Callouts
    Schedule Graphics
    Electrical Fixture Tags
    Telephone Device Tags
    Cable Trays
    Curtain System Tags
    Structural Stiffeners
    Internal Line Load Tags
    Structural Fabric Reinforcement Symbols
    Mass Tags
    Analytical Node Tags
    Property Tags
    Structural Path Reinforcement Tags
    Callout Boundary
    Structural Area Reinforcement Symbols
    Contour Labels
    Areas
    Materials
    Structural Fabric Areas
    Structural Rebar
    Reference Points
    Shaft Openings
    Spot Elevation Symbols
    Internal Point Load Tags
    Analytical Isolated Foundation Tags
    Flex Pipe Tags
    Duct Fittings
    Cameras
    Elevations
    Analytical Floor Tags
    Pipe Accessories
    Structural Connection Tags
    Masking Region
    Level Heads
    Duct Color Fill Legends
    Analytical Beams
    Curtain Grids
    Levels
    Brace in Plan View Symbols
    Railing Tags
    Structural Connection Handlers
    Structural Foundation Tags
    Wire Tags
    Site Tags
    Pipe Tags
    Analytical Link Tags
    Spot Coordinates
    Railings
    Viewports
    Title Blocks
    Plumbing Fixture Tags
    Pipe Fitting Tags
    Duct Color Fill
    Stair Paths
    Duct Linings
    Structural Beam Systems
    Roof Tags
    Views
    Sheets
    Conduit Tags
    Point Load Tags
    Analytical Surfaces
    Structural Fabric Reinforcement Tags
    Material Tags
    View Titles
    Parking Tags
    Structural Beam System Tags
    Analytical Brace Tags
    Electrical Equipment Tags
    Generic Model Tags
    Switch System
    Rooms
    Analytical Walls
    Text Notes
    Detail Items
    Spot Elevations
    Analytical Nodes
    Boundary Conditions
    Color Fill Legends
    Spaces
    Dimensions

Enjoy!

If you find the article, the code, or the RevitNetAddinWizard(Pro) useful, please kindly make a donation through clicking the right button from the following link:

Download RevitNetAddinWizardPro and/or Donate



 

Revit .NET API: Categorize Revit Categories (pt. 5) - Based on IsCuttable

$
0
0

Besides those important parameters, built-in or custom, project or family, modifiable or read-only, Revit also has many categories, which can be categorized or grouped further based on different criteria or purposes.

In this post, let’s categorize Revit Categories based on the IsCuttable criteria that the Category object itself carries on.

        public static Dictionary<string, List<Category>> CategorizeCategories5(RvtDocument doc)
        {
            string tempFile = @"c:\temp\CategorizedCategories5.txt";
            Dictionary<string, List<Category>> ret = new Dictionary<string, List<Category>>();
            ret.Add("IsCuttable", new List<Category>());
            ret.Add("NOT IsCuttable", new List<Category>());
            try
            {
                foreach (Category c in doc.Settings.Categories)
                {
                    if (c.Id.IntegerValue != (int)BuiltInCategory.INVALID)
                    {
                        if (c.IsCuttable == true)
                            ret.First().Value.Add(c);
                        else
                            ret.Last().Value.Add(c);
                    }
                }
                List<Category> sorted = ret.First().Value.OrderBy(f => f.Name).ToList();
                ret.First().Value.Clear();
                ret.First().Value.AddRange(sorted);
                using (StreamWriter sw = new StreamWriter(tempFile))
                {
                    foreach (KeyValuePair<string, List<Category>> kvp in ret)
                    {
                        sw.WriteLine(kvp.Key.ToString());
                        foreach (Category c in kvp.Value)
                        {
                            sw.WriteLine(string.Format("\t{0}", c.Name));
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.ToString());
            }

            return ret;
        }

The output may be as follows:

IsCuttable
    Assemblies
    Casework
    Ceilings
    Columns
    Curtain Panels
    Curtain Systems
    Curtain Wall Mullions
    Doors
    Floors
    Generic Models
    Mass
    Parts
    Railings
    Ramps
    Rebar Shape
    Roads
    Roofs
    Site
    Stairs
    Structural Area Reinforcement
    Structural Columns
    Structural Connection Handlers
    Structural Connections
    Structural Fabric Areas
    Structural Fabric Reinforcement
    Structural Foundations
    Structural Framing
    Structural Path Reinforcement
    Structural Rebar
    Structural Stiffeners
    Topography
    Walls
    Windows
NOT IsCuttable
    Part Tags
    Pipe Insulation Tags
    Analytical Floors
    Mechanical Equipment Tags
    Cable Tray Fittings
    Foundation Span Direction Symbol
    Communication Device Tags
    Analytical Wall Tags
    Planting
    Ceiling Tags
    Analytical Wall Foundations
    Furniture Tags
    Air Terminals
    Pipe Accessory Tags
    Security Device Tags
    Window Tags
    Stair Tread/Riser Numbers
    Communication Devices
    Piping Systems
    Panel Schedule Graphics
    Detail Item Tags
    Reference Lines
    Analytical Spaces
    Plumbing Fixtures
    Structural Framing Tags
    Section Boxes
    Elevation Marks
    Data Device Tags
    Pipe Segments
    Conduit Fittings
    Sprinklers
    Lighting Fixture Tags
    Lighting Devices
    Assembly Tags
    Duct Tags
    Structural Rebar Tags
    Parking
    Ducts
    Door Tags
    Internal Area Load Tags
    Revision Clouds
    Imports in Families
    Conduits
    Multi-Category Tags
    Analytical Isolated Foundations
    Flex Pipes
    Property Line Segment Tags
    Curtain Panel Tags
    Analytical Links
    Structural Trusses
    HVAC Zones
    Mass Floor Tags
    Analytical Columns
    Duct Systems
    Zone Tags
    Duct Placeholders
    Reference Planes
    Cable Tray Tags
    Multi-Rebar Annotations
    Matchline
    Specialty Equipment Tags
    Duct Accessories
    Duct Fitting Tags
    Furniture System Tags
    Callout Heads
    Furniture Systems
    Telephone Devices
    Lines
    Wires
    Pipes
    Structural Stiffener Tags
    Casework Tags
    Project Information
    Wall Tags
    Cable Tray Fitting Tags
    Fabrication Parts
    Structural Internal Loads
    Analysis Display Style
    Pipe Insulations
    Flex Ducts
    Duct Insulation Tags
    Rebar Cover References
    Structural Load Cases
    Stair Support Tags
    Structural Truss Tags
    Analytical Slab Foundation Tags
    Plan Region
    Electrical Fixtures
    Air Terminal Tags
    Data Devices
    Structural Annotations
    Lighting Fixtures
    Duct Insulations
    Span Direction Symbol
    Section Line
    Cable Tray Runs
    Section Marks
    Pipe Color Fill
    Lighting Device Tags
    Floor Tags
    Sprinkler Tags
    Analysis Results
    Scope Boxes
    Line Load Tags
    Render Regions
    Structural Path Reinforcement Symbols
    Electrical Equipment
    Stair Landing Tags
    Fire Alarm Devices
    Analytical Braces
    Displacement Path
    Duct Lining Tags
    Flex Duct Tags
    Point Clouds
    Analytical Wall Foundation Tags
    Analytical Foundation Slabs
    Structural Area Reinforcement Tags
    Stair Run Tags
    Nurse Call Device Tags
    Area Load Tags
    Routing Preferences
    Generic Annotations
    Area Tags
    View Reference
    Filled region
    Analytical Column Tags
    Connection Symbols
    Conduit Fitting Tags
    Raster Images
    Structural Column Tags
    Analytical Beam Tags
    Adaptive Points
    Fabrication Part Tags
    Grid Heads
    Sections
    Room Tags
    Stair Tags
    Structural Loads
    Revision Cloud Tags
    Conduit Runs
    Duct Accessory Tags
    Spot Slopes
    Keynote Tags
    Space Tags
    Rebar Set Toggle
    Pipe Color Fill Legends
    Pipe Fittings
    Pipe Placeholders
    Guide Grid
    Grids
    Fire Alarm Device Tags
    Planting Tags
    Callouts
    Schedule Graphics
    Electrical Fixture Tags
    Telephone Device Tags
    Cable Trays
    Curtain System Tags
    Entourage
    Internal Line Load Tags
    Structural Fabric Reinforcement Symbols
    Mass Tags
    Analytical Node Tags
    Property Tags
    Structural Path Reinforcement Tags
    Callout Boundary
    Structural Area Reinforcement Symbols
    Contour Labels
    Nurse Call Devices
    Areas
    Materials
    Reference Points
    Shaft Openings
    Spot Elevation Symbols
    Internal Point Load Tags
    Analytical Isolated Foundation Tags
    Flex Pipe Tags
    Duct Fittings
    Cameras
    Elevations
    Specialty Equipment
    Analytical Floor Tags
    Pipe Accessories
    Structural Connection Tags
    Masking Region
    Level Heads
    Duct Color Fill Legends
    Analytical Beams
    Curtain Grids
    Levels
    Brace in Plan View Symbols
    Railing Tags
    Structural Foundation Tags
    Wire Tags
    Security Devices
    Site Tags
    Pipe Tags
    Analytical Link Tags
    Spot Coordinates
    Viewports
    Title Blocks
    Plumbing Fixture Tags
    Pipe Fitting Tags
    Duct Color Fill
    Stair Paths
    Duct Linings
    Structural Beam Systems
    Roof Tags
    Views
    Sheets
    Conduit Tags
    Point Load Tags
    Analytical Surfaces
    Structural Fabric Reinforcement Tags
    Material Tags
    View Titles
    Mechanical Equipment
    Parking Tags
    Structural Beam System Tags
    Analytical Brace Tags
    Electrical Equipment Tags
    Generic Model Tags
    Switch System
    Furniture
    Rooms
    Analytical Walls
    Text Notes
    Detail Items
    Spot Elevations
    Analytical Nodes
    Boundary Conditions
    Color Fill Legends
    Spaces
    Dimensions

Enjoy!

If you find the article, the code, or the RevitNetAddinWizard(Pro) useful, please kindly make a donation through clicking the right button from the following link:

Download RevitNetAddinWizardPro and/or Donate

Revit .NET API: Categorize Revit Categories (pt. 6) - Based on IsReadOnly

$
0
0

Besides those important parameters, built-in or custom, project or family, modifiable or read-only, Revit also has many categories, which can be categorized or grouped further based on different criteria or purposes.

In this post, let’s categorize Revit Categories based on the IsReadOnly criteria that the Category object itself carries on.

        public static Dictionary<string, List<Category>> CategorizeCategories6(RvtDocument doc)
        {
            string tempFile = @"c:\temp\CategorizedCategories6.txt";
            Dictionary<string, List<Category>> ret = new Dictionary<string, List<Category>>();
            ret.Add("IsReadOnly", new List<Category>());
            ret.Add("NOT IsReadOnly", new List<Category>());
            try
            {
                foreach (Category c in doc.Settings.Categories)
                {
                    if (c.Id.IntegerValue != (int)BuiltInCategory.INVALID)
                    {
                        if (c.IsReadOnly == true)
                            ret.First().Value.Add(c);
                        else
                            ret.Last().Value.Add(c);
                    }
                }
                List<Category> sorted = ret.First().Value.OrderBy(f => f.Name).ToList();
                ret.First().Value.Clear();
                ret.First().Value.AddRange(sorted);
                using (StreamWriter sw = new StreamWriter(tempFile))
                {
                    foreach (KeyValuePair<string, List<Category>> kvp in ret)
                    {
                        sw.WriteLine(kvp.Key.ToString());
                        foreach (Category c in kvp.Value)
                        {
                            sw.WriteLine(string.Format("\t{0}", c.Name));
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.ToString());
            }

            return ret;
        }

The output may be as follows:

IsReadOnly
NOT IsReadOnly
    Part Tags
    Pipe Insulation Tags
    Analytical Floors
    Mechanical Equipment Tags
    Ramps
    Cable Tray Fittings
    Foundation Span Direction Symbol
    Communication Device Tags
    Analytical Wall Tags
    Structural Connections
    Planting
    Ceiling Tags
    Analytical Wall Foundations
    Furniture Tags
    Mass
    Air Terminals
    Pipe Accessory Tags
    Security Device Tags
    Window Tags
    Stair Tread/Riser Numbers
    Communication Devices
    Piping Systems
    Panel Schedule Graphics
    Detail Item Tags
    Reference Lines
    Analytical Spaces
    Plumbing Fixtures
    Structural Framing Tags
    Ceilings
    Section Boxes
    Elevation Marks
    Data Device Tags
    Pipe Segments
    Conduit Fittings
    Sprinklers
    Doors
    Lighting Fixture Tags
    Lighting Devices
    Assembly Tags
    Duct Tags
    Curtain Systems
    Structural Rebar Tags
    Parking
    Ducts
    Door Tags
    Internal Area Load Tags
    Revision Clouds
    Imports in Families
    Conduits
    Multi-Category Tags
    Analytical Isolated Foundations
    Flex Pipes
    Property Line Segment Tags
    Curtain Panel Tags
    Analytical Links
    Structural Trusses
    HVAC Zones
    Mass Floor Tags
    Site
    Analytical Columns
    Duct Systems
    Zone Tags
    Duct Placeholders
    Reference Planes
    Cable Tray Tags
    Multi-Rebar Annotations
    Matchline
    Specialty Equipment Tags
    Duct Accessories
    Duct Fitting Tags
    Furniture System Tags
    Callout Heads
    Furniture Systems
    Telephone Devices
    Lines
    Wires
    Pipes
    Structural Stiffener Tags
    Topography
    Casework Tags
    Project Information
    Wall Tags
    Cable Tray Fitting Tags
    Fabrication Parts
    Structural Internal Loads
    Analysis Display Style
    Pipe Insulations
    Flex Ducts
    Duct Insulation Tags
    Rebar Cover References
    Assemblies
    Structural Load Cases
    Stair Support Tags
    Structural Area Reinforcement
    Structural Truss Tags
    Analytical Slab Foundation Tags
    Plan Region
    Structural Framing
    Electrical Fixtures
    Air Terminal Tags
    Data Devices
    Structural Annotations
    Lighting Fixtures
    Duct Insulations
    Span Direction Symbol
    Section Line
    Cable Tray Runs
    Section Marks
    Pipe Color Fill
    Generic Models
    Lighting Device Tags
    Floor Tags
    Sprinkler Tags
    Analysis Results
    Scope Boxes
    Line Load Tags
    Render Regions
    Structural Path Reinforcement Symbols
    Electrical Equipment
    Stair Landing Tags
    Curtain Panels
    Fire Alarm Devices
    Analytical Braces
    Displacement Path
    Roads
    Duct Lining Tags
    Floors
    Flex Duct Tags
    Point Clouds
    Analytical Wall Foundation Tags
    Analytical Foundation Slabs
    Windows
    Structural Area Reinforcement Tags
    Structural Path Reinforcement
    Stair Run Tags
    Rebar Shape
    Parts
    Nurse Call Device Tags
    Columns
    Area Load Tags
    Routing Preferences
    Generic Annotations
    Area Tags
    View Reference
    Filled region
    Analytical Column Tags
    Structural Fabric Reinforcement
    Connection Symbols
    Conduit Fitting Tags
    Raster Images
    Structural Column Tags
    Analytical Beam Tags
    Adaptive Points
    Fabrication Part Tags
    Grid Heads
    Sections
    Room Tags
    Curtain Wall Mullions
    Stair Tags
    Structural Loads
    Revision Cloud Tags
    Walls
    Conduit Runs
    Duct Accessory Tags
    Spot Slopes
    Keynote Tags
    Space Tags
    Rebar Set Toggle
    Pipe Color Fill Legends
    Pipe Fittings
    Structural Columns
    Pipe Placeholders
    Guide Grid
    Grids
    Fire Alarm Device Tags
    Planting Tags
    Callouts
    Schedule Graphics
    Electrical Fixture Tags
    Telephone Device Tags
    Cable Trays
    Curtain System Tags
    Structural Stiffeners
    Entourage
    Internal Line Load Tags
    Structural Fabric Reinforcement Symbols
    Mass Tags
    Analytical Node Tags
    Property Tags
    Structural Path Reinforcement Tags
    Callout Boundary
    Structural Area Reinforcement Symbols
    Contour Labels
    Nurse Call Devices
    Areas
    Materials
    Roofs
    Structural Fabric Areas
    Structural Rebar
    Reference Points
    Shaft Openings
    Spot Elevation Symbols
    Internal Point Load Tags
    Analytical Isolated Foundation Tags
    Flex Pipe Tags
    Duct Fittings
    Cameras
    Elevations
    Specialty Equipment
    Analytical Floor Tags
    Pipe Accessories
    Structural Connection Tags
    Masking Region
    Structural Foundations
    Level Heads
    Duct Color Fill Legends
    Analytical Beams
    Curtain Grids
    Levels
    Brace in Plan View Symbols
    Railing Tags
    Structural Connection Handlers
    Structural Foundation Tags
    Wire Tags
    Security Devices
    Site Tags
    Pipe Tags
    Analytical Link Tags
    Spot Coordinates
    Railings
    Viewports
    Title Blocks
    Plumbing Fixture Tags
    Pipe Fitting Tags
    Duct Color Fill
    Stair Paths
    Duct Linings
    Structural Beam Systems
    Roof Tags
    Views
    Sheets
    Casework
    Conduit Tags
    Point Load Tags
    Analytical Surfaces
    Structural Fabric Reinforcement Tags
    Material Tags
    View Titles
    Mechanical Equipment
    Parking Tags
    Structural Beam System Tags
    Analytical Brace Tags
    Electrical Equipment Tags
    Generic Model Tags
    Switch System
    Furniture
    Rooms
    Analytical Walls
    Stairs
    Text Notes
    Detail Items
    Spot Elevations
    Analytical Nodes
    Boundary Conditions
    Color Fill Legends
    Spaces
    Dimensions

Enjoy!

If you find the article, the code, or the RevitNetAddinWizard(Pro) useful, please kindly make a donation through clicking the right button from the following link:

Download RevitNetAddinWizardPro and/or Donate


Revit .NET API: Categorize Revit Categories (pt. 7) - Based on IsTagCategory

$
0
0

Besides those important parameters, built-in or custom, project or family, modifiable or read-only, Revit also has many categories, which can be categorized or grouped further based on different criteria or purposes.

In this post, let’s categorize Revit Categories based on the IsTagCategory criteria that the Category object itself carries on.

        public static Dictionary<string, List<Category>> CategorizeCategories7(RvtDocument doc)
        {
            string tempFile = @"c:\temp\CategorizedCategories7.txt";
            Dictionary<string, List<Category>> ret = new Dictionary<string, List<Category>>();
            ret.Add("IsTagCategory", new List<Category>());
            ret.Add("NOT IsTagCategory", new List<Category>());
            try
            {
                foreach (Category c in doc.Settings.Categories)
                {
                    if (c.Id.IntegerValue != (int)BuiltInCategory.INVALID)
                    {
                        if (c.IsTagCategory == true)
                            ret.First().Value.Add(c);
                        else
                            ret.Last().Value.Add(c);
                    }
                }
                List<Category> sorted = ret.First().Value.OrderBy(f => f.Name).ToList();
                ret.First().Value.Clear();
                ret.First().Value.AddRange(sorted);
                using (StreamWriter sw = new StreamWriter(tempFile))
                {
                    foreach (KeyValuePair<string, List<Category>> kvp in ret)
                    {
                        sw.WriteLine(kvp.Key.ToString());
                        foreach (Category c in kvp.Value)
                        {
                            sw.WriteLine(string.Format("\t{0}", c.Name));
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.ToString());
            }

            return ret;
        }

The output may be as follows:

IsTagCategory
    Air Terminal Tags
    Analytical Beam Tags
    Analytical Brace Tags
    Analytical Column Tags
    Analytical Floor Tags
    Analytical Isolated Foundation Tags
    Analytical Link Tags
    Analytical Node Tags
    Analytical Slab Foundation Tags
    Analytical Wall Foundation Tags
    Analytical Wall Tags
    Area Load Tags
    Area Tags
    Assembly Tags
    Cable Tray Fitting Tags
    Cable Tray Tags
    Callout Heads
    Casework Tags
    Ceiling Tags
    Communication Device Tags
    Conduit Fitting Tags
    Conduit Tags
    Curtain Panel Tags
    Data Device Tags
    Detail Item Tags
    Door Tags
    Duct Accessory Tags
    Duct Fitting Tags
    Duct Insulation Tags
    Duct Lining Tags
    Duct Tags
    Electrical Equipment Tags
    Electrical Fixture Tags
    Elevation Marks
    Fabrication Part Tags
    Fire Alarm Device Tags
    Flex Duct Tags
    Flex Pipe Tags
    Floor Tags
    Foundation Span Direction Symbol
    Furniture System Tags
    Furniture Tags
    Generic Model Tags
    Grid Heads
    Internal Area Load Tags
    Internal Line Load Tags
    Internal Point Load Tags
    Level Heads
    Lighting Device Tags
    Lighting Fixture Tags
    Line Load Tags
    Mass Floor Tags
    Mass Tags
    Mechanical Equipment Tags
    Nurse Call Device Tags
    Parking Tags
    Part Tags
    Pipe Accessory Tags
    Pipe Fitting Tags
    Pipe Insulation Tags
    Pipe Tags
    Planting Tags
    Plumbing Fixture Tags
    Point Load Tags
    Property Line Segment Tags
    Property Tags
    Railing Tags
    Revision Cloud Tags
    Roof Tags
    Room Tags
    Section Marks
    Security Device Tags
    Site Tags
    Space Tags
    Span Direction Symbol
    Specialty Equipment Tags
    Spot Elevation Symbols
    Sprinkler Tags
    Stair Landing Tags
    Stair Run Tags
    Stair Support Tags
    Stair Tags
    Structural Area Reinforcement Symbols
    Structural Area Reinforcement Tags
    Structural Beam System Tags
    Structural Column Tags
    Structural Connection Tags
    Structural Fabric Reinforcement Symbols
    Structural Fabric Reinforcement Tags
    Structural Foundation Tags
    Structural Framing Tags
    Structural Path Reinforcement Symbols
    Structural Path Reinforcement Tags
    Structural Rebar Tags
    Structural Stiffener Tags
    Structural Truss Tags
    Telephone Device Tags
    Title Blocks
    View Reference
    View Titles
    Wall Tags
    Window Tags
    Wire Tags
    Zone Tags
NOT IsTagCategory
    Analytical Floors
    Ramps
    Cable Tray Fittings
    Structural Connections
    Planting
    Analytical Wall Foundations
    Mass
    Air Terminals
    Stair Tread/Riser Numbers
    Communication Devices
    Piping Systems
    Panel Schedule Graphics
    Reference Lines
    Analytical Spaces
    Plumbing Fixtures
    Ceilings
    Section Boxes
    Pipe Segments
    Conduit Fittings
    Sprinklers
    Doors
    Lighting Devices
    Curtain Systems
    Parking
    Ducts
    Revision Clouds
    Imports in Families
    Conduits
    Multi-Category Tags
    Analytical Isolated Foundations
    Flex Pipes
    Analytical Links
    Structural Trusses
    HVAC Zones
    Site
    Analytical Columns
    Duct Systems
    Duct Placeholders
    Reference Planes
    Multi-Rebar Annotations
    Matchline
    Duct Accessories
    Furniture Systems
    Telephone Devices
    Lines
    Wires
    Pipes
    Topography
    Project Information
    Fabrication Parts
    Structural Internal Loads
    Analysis Display Style
    Pipe Insulations
    Flex Ducts
    Rebar Cover References
    Assemblies
    Structural Load Cases
    Structural Area Reinforcement
    Plan Region
    Structural Framing
    Electrical Fixtures
    Data Devices
    Structural Annotations
    Lighting Fixtures
    Duct Insulations
    Section Line
    Cable Tray Runs
    Pipe Color Fill
    Generic Models
    Analysis Results
    Scope Boxes
    Render Regions
    Electrical Equipment
    Curtain Panels
    Fire Alarm Devices
    Analytical Braces
    Displacement Path
    Roads
    Floors
    Point Clouds
    Analytical Foundation Slabs
    Windows
    Structural Path Reinforcement
    Rebar Shape
    Parts
    Columns
    Routing Preferences
    Generic Annotations
    Filled region
    Structural Fabric Reinforcement
    Connection Symbols
    Raster Images
    Adaptive Points
    Sections
    Curtain Wall Mullions
    Structural Loads
    Walls
    Conduit Runs
    Spot Slopes
    Keynote Tags
    Rebar Set Toggle
    Pipe Color Fill Legends
    Pipe Fittings
    Structural Columns
    Pipe Placeholders
    Guide Grid
    Grids
    Callouts
    Schedule Graphics
    Cable Trays
    Curtain System Tags
    Structural Stiffeners
    Entourage
    Callout Boundary
    Contour Labels
    Nurse Call Devices
    Areas
    Materials
    Roofs
    Structural Fabric Areas
    Structural Rebar
    Reference Points
    Shaft Openings
    Duct Fittings
    Cameras
    Elevations
    Specialty Equipment
    Pipe Accessories
    Masking Region
    Structural Foundations
    Duct Color Fill Legends
    Analytical Beams
    Curtain Grids
    Levels
    Brace in Plan View Symbols
    Structural Connection Handlers
    Security Devices
    Spot Coordinates
    Railings
    Viewports
    Duct Color Fill
    Stair Paths
    Duct Linings
    Structural Beam Systems
    Views
    Sheets
    Casework
    Analytical Surfaces
    Material Tags
    Mechanical Equipment
    Switch System
    Furniture
    Rooms
    Analytical Walls
    Stairs
    Text Notes
    Detail Items
    Spot Elevations
    Analytical Nodes
    Boundary Conditions
    Color Fill Legends
    Spaces
    Dimensions

Enjoy!

If you find the article, the code, or the RevitNetAddinWizard(Pro) useful, please kindly make a donation through clicking the right button from the following link:

Download RevitNetAddinWizardPro and/or Donate

Visual Smarter build #0.8.5.0 has been released

C#: ‘var’ Is Some Nice Sugar If Properly Used But …

$
0
0

It seems the C# ‘var’ is gaining more and more popular nowadays. More and more people like it and use it more often. It is true that using ‘var’ can save some typing and at the same time make code look concise.

However, is it good to use it always as some exercise in their coding and advocate to others?

It does not sound so.

One support for using 'var' is that the Visual Studio IDE can hint us what the ‘var’ really represents if the mouse cursor is hovering over it and people can generally guess out from the real expression by looking at the code itself even if editors not supporting intellisense are being used.

It is partially true. Using the following code for example, the return value of the method GetCustomers() most likely be some collections.

        void UseVarAlways()
        {
            var all = GetCustomers();
            var other = GetCustomers();
            all.AddRange(other);
        }

Ah, yes. The guess is correct in this case. The method is defined like this:

        List<string>  GetCustomers()
        {
            var customers = new List<string> { "A", "B", "C" };
            return customers;
        }

However, collection in .NET has various forms such as IEnumerable, IList and Dictionary and its element can be of all possible type such as some other collection and the Object. In addition, it is common and good for the same method to return an array too.

        string[] GetCustomers()
        {
            var customers = new string[] { "A", "B", "C" };
            return customers;
        }

If this is the case, the code does not compile either, the same as some explicit return type being used. The following error will be complained by the compiler.

'System.Array' does not contain a definition for 'AddRange' and no extension method 'AddRange' accepting a first argument of type 'System.Array' could be found (are you missing a using directive or an assembly reference?)    

The same fact also revokes the argument that using ‘var’ can get rid of issues caused by changes to method return types. It is only true if the return type and value is not used at all or only some very common property or method such as ‘Type’, ‘Name’, and ‘ToString()’ being used, but in reality it rarely happens. In the first situation, otherwise, the ‘var’ can also be saved. C# allows to call methods that way.

It is fortunate here that the compiler helps easily figure the problem. In some subtle cases however, tricky issues could happen if ‘var’ is always used and some method return types being changed. The reason is simple like this, the inferred type is not always as expected.

So, sugar could be good for health if used a little at right times, but could be very harmful if being abused.

Visual Smarter build #0.9.2.0 has been released

$
0
0
Visual Smarter build #0.9.2.0 has been released. It has more 200 various widgets already. Please feel free to download it from the following web and give it a try. http://visualsmarter.blogspot.com/

RevitAddinWizardPro build #1.0.8.0 and NavisworksNetAddinWizardPro build #1.0.6.0 have been released

$
0
0

Revit .NET Addin Wizard Professional (RevitAddinWizardPro) build #1.0.8.0 and Navisworks .NET Addin Wizard Professional (NavisworksNetAddinWizardPro) build #1.0.6.0 have been released.

Some side by side issues have been addressed, especially with the Visual Smarter. The installer/uninstaller features have also been enhanced. Now those toolbars and commands of the relevant wizards, codes and widgets will be cleaned up during un-installations.

Revit .NET Addin Wizards/Coders/Widgets

Navisworks .NET Addin Wizards/Coders/Widgets

Visual Smarter

 

Viewing all 872 articles
Browse latest View live