Hi,
I was looking the customs properties of my block (Name: Visibilité1, Value: DISCRET_D) and I finally find it here:
using (CadImage cadImage = (CadImage)Aspose.CAD.Image.Load(dwgPath))
{
foreach (CadBaseObject cadObject in cadImage.Objects)
{
if (cadObject is CadXRecord xRecord)
{
foreach (CadCodeValue codeValue in xRecord.Objects)
{
if (codeValue.Value == "DISCRET_D")
{
// Here I find it
}
}
}
}
}
The problem is that I can’t find a properties in my cadObject to reference to the block in my Cad. I looked inside the CadInsertObject, the CadBaseEntity and I can’t find a way to reference the CadObject to one of those.
CadBlockDictionary dictionary = cadImage.BlockEntities;
foreach (CadBaseEntity entity in cadImage.Entities)
{
if (entity is CadInsertObject insertObject)
{
if (insertObject.OriginalBlockName == "LOG_0004")
{
foreach (CadBlockEntity entityValue in dictionary.Values)
{
if (entityValue.Name == insertObject.Name)
{
foreach (CadBaseEntity bloc in entityValue.Entities)
{
}
}
}
if (insertObject != null && insertObject.ChildObjects != null && insertObject.ChildObjects.Count > 0)
{
// VariableBit is my Class that I create from the info in insertObject and the CadBaseEntity from cadImage
VariableBit variableBit = new(insertObject, cadImage);
variableBits.Add(variableBit);
}
}
}
}
How do you reference a CadObject to a block (CadInsertObject or CadBlockEntity or CadBaseEntity or whatever?
Thank you!