Hi,
as far as I can see, the ImportInstance's CADLinkType.Name property can be set.
Give it a try.
Revitalizer
Hi,
CADLinkType.Name only change the Type name of the dwg.(Like the image below)
so far i can get the Category of dwg by
doc.Settings.Categories.get_Item(dwg.name);
but i don't know how to edit it.
Hi,
I have the same problem. I can change material but not rename layer. Please let me know
[Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)]
public class ViewCategories : IExternalCommand
{
public Autodesk.Revit.UI.Result Execute(ExternalCommandData commandData,
ref string message, ElementSet elements)
{
try
{
UIDocument uidoc = commandData.Application.ActiveUIDocument;
Document doc = uidoc.Document;
View view = doc.ActiveView;
using (Transaction t = new Transaction(doc, "Change Imported dwg visibility"))
{
t.Start();
String prompt = "";
foreach (Category cat in view.Document.Settings.Categories)
{
if (cat.Name.StartsWith("Imported in families"))
{
CategoryNameMap objA = cat.SubCategories;
CategoryNameMapIterator objB = objA.ForwardIterator();
while (objB.MoveNext())
{
Category cat2 = objA.get_Item(objB.Key);
switch (cat2.Name.ToUpper())
{
case "LAYERFOUND":
cat2.Material = getMaterialFromName("NewMaterialName", doc);
break;
default:
break;
}
}
}
}
TaskDialog.Show("Revit", prompt);
t.Commit();
}
}
catch (Exception e)
{
message = e.Message;
return Autodesk.Revit.UI.Result.Failed;
}
return Autodesk.Revit.UI.Result.Succeeded;
}
Someone can help with this issue?
I have the same problem..
Is there any way to rename an imported layer in Revit ?
Thanks, Thomas