Announcements

Starting in December, we will archive content from the community that is 10 years and older. This FAQ provides more information.

ExternalDefinitionCreationOptions Visible property

jjesusdelpino
Advocate
Advocate

ExternalDefinitionCreationOptions Visible property

jjesusdelpino
Advocate
Advocate

Hi all! So I got this code I use to add a shared parameter as a project parameter. For now, its working properly. My doubt is with the "Visible" property of the ExternalDefinitionCreationOptions object. According to the API, this property is "True if the parameter is visible to the user, false if it is hidden and accesible only via the API. The default is true.". The thing is, no matter if I use opt.Visble = true or opt.Visible = false in this code, the parameter is always visible so I dont know what Im missing here. Any ideas? Thanks!

 


            DefinitionFile ParametrosCompartidosArchivo = app.OpenSharedParameterFile();
            DefinitionGroup GrupoParametrosCompartidos = ParametrosCompartidosArchivo.Groups.get_Item("GroupName");
            ExternalDefinitionCreationOptions opt = new ExternalDefinitionCreationOptions("ParameterName", ParameterType.Text);
            opt.Visible = false;

            //or opt.Visible = true; same result
            Parametro = GrupoParametrosCompartidos.Definitions.Create(opt);
        
            using(Transaction t = new Transaction(doc))
            {
                t.Start("Crear parámetro compartido");
                Binding EnlaceCategorias = app.Create.NewInstanceBinding(CatSet);  
                doc.ParameterBindings.Insert(Parametro, EnlaceCategorias, BuiltInParameterGroup.PG_VISIBILITY);
                t.Commit();

              }

0 Likes
Reply
Accepted solutions (1)
493 Views
1 Reply
Reply (1)

jjesusdelpino
Advocate
Advocate
Accepted solution

This same code is working after restarting Revit so I think that there is not a problem anymore. Sorry for the inconvenience, I dont know what was happening.

0 Likes