Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi.
I want to get all codes in one Code Set Style. (For example: "Básico" style).
that style is:
Vínculo (Link) branch has 2 code (NormalItemType), Mark branch has 2 code (NormalItemType) and Shape has 3 codes (NormalItemType).
However, if I do this:
int indice = comboBox_estilos.SelectedIndex;
ObjectId id_estil = coll_Id[indice];
using (Transaction trans = HostApplicationServices.WorkingDatabase.TransactionManager.StartTransaction())
{
Autodesk.Civil.DatabaseServices.Styles.CodeSetStyle estilo_ConjuntoCode = trans.GetObject(id_estil, OpenMode.ForWrite) as Autodesk.Civil.DatabaseServices.Styles.CodeSetStyle;
Autodesk.Civil.DatabaseServices.Styles.SubassemblySubentityStyleType tipe=estilo_ConjuntoCode.SubentityStyleType;
switch (tipe)
{
case Autodesk.Civil.DatabaseServices.Styles.SubassemblySubentityStyleType.LinkType:
break;
case Autodesk.Civil.DatabaseServices.Styles.SubassemblySubentityStyleType.MarkerType:
break;
case Autodesk.Civil.DatabaseServices.Styles.SubassemblySubentityStyleType.ShapeType:
break;
}
//bucle para cada uno de los códigos que contiene
for (int i = 0; i <= estilo_ConjuntoCode.Count - 1; i++)
{
Autodesk.Civil.DatabaseServices.Styles.CodeSetStyleItem codigo = estilo_ConjuntoCode[i];
Autodesk.Civil.DatabaseServices.Styles.SubassemblySubentityStyleType tipo= codigo.StyleType;
}
I only get the "SubEntityStyleType"=MarkerType and its 2 codes.
But, why I can´t get the codes from LinkType and ShapeType?
I know this: This property can't apply to DefaultCode item and NoCode item. I only want NormalItemType.
Moreover;
SubassemblySubentityStyleType Enumeration:
Member name Value
| ShapeType | 2 | ||
| MarkerType | 0 | ||
| LinkType | 1 |
This is an example to .Add() method from API guide:
1// Create a new style set using our previously created styles. 2objId = doc.Styles.ShapeStyles.Add("Style Set 1"); 3CodeSetStyle oCodeSetStyle = ts.GetObject(objId, OpenMode.ForWrite) as CodeSetStyle; 4oCodeSetStyle.Add("TOP", doc.Styles.LinkStyles["Style2"]); 5oCodeSetStyle.Add("BASE", doc.Styles.ShapeStyles["Style3"]); 6 7ts.Commit();
Thanks.
Autocad C3D 2019 SP3, 2020 & 2021
Intel I9 9900K with frontal watercooler alphacool eisbaer 360 (original fans mounted in pull)- 3 fans Corsair 120 ML PRO in push.
MOBO Gygabyte Z390 Aorus Master- Corsair RGB Vengeance 64GB RAM (4x16) CL16
Nvidia Quadro RTX 4000
Samsung 970 EVO PLUS 1TB (unit C). Samsung 970 PRO 512GB (for data)
Power Supply: Corsair TX850M PLUS
Descubre mi programa VisorNET para Civil 3D:
https://apps.autodesk.com/CIV3D/es/Detail/Index?id=appstore.exchange.autodesk.com%3avisornet_windows32and64%3aes
Intel I9 9900K with frontal watercooler alphacool eisbaer 360 (original fans mounted in pull)- 3 fans Corsair 120 ML PRO in push.
MOBO Gygabyte Z390 Aorus Master- Corsair RGB Vengeance 64GB RAM (4x16) CL16
Nvidia Quadro RTX 4000
Samsung 970 EVO PLUS 1TB (unit C). Samsung 970 PRO 512GB (for data)
Power Supply: Corsair TX850M PLUS
Descubre mi programa VisorNET para Civil 3D:
https://apps.autodesk.com/CIV3D/es/Detail/Index?id=appstore.exchange.autodesk.com%3avisornet_windows32and64%3aes
Solved! Go to Solution.