Deleting Line Styles

Deleting Line Styles

mm1452
Enthusiast Enthusiast
1,140 Views
3 Replies
Message 1 of 4

Deleting Line Styles

mm1452
Enthusiast
Enthusiast

Hi,

 

When I Run the below code to delete specific line styles. Revit deletes its values but dose not delete it. (See Attached Snap Shot)

so how can I permanently delete the line style.

private void AdjustLineStyles()
{
    List<ElementId> idsToBeDeleted = new List<ElementId>();
    foreach (DetailCurve dL in newDetailLines)
    {
        idsToBeDeleted.Add(dL.LineStyle.Id);
        dL.CreateLineStyleByColor(doc);
        dL.LineStyle = dL.GetLineStyleByColor(doc);
    }
    doc.Delete(idsToBeDeleted);
}
0 Likes
1,141 Views
3 Replies
Replies (3)
Message 2 of 4

Revitalizer
Advisor
Advisor

Hi,

 

Transaction needed ?

 

 

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





Message 3 of 4

mm1452
Enthusiast
Enthusiast

it's automatic

 

[TransactionAttribute(TransactionMode.Automatic)]
0 Likes
Message 4 of 4

Revitalizer
Advisor
Advisor

Hi,

 

once added a new sub-category,

 

there are two new GraphicsStyle Elements of that name in the database.

One of GraphicsStyleType.Projection, one for GraphicsStyleType.Cut.

 

If you delete one, the other one still exists.

 

That's my assumption.

 

 

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





0 Likes