Hi All,
I am new to dotnet.
Please any one help me to how to delete polyline within a Block by using C#.net.
I like this request, it's bold and not a little ambiguous. The straight-forward interpretation "delete a polyline which is nested in a block" needs more information to be practical: how would I identify a certain polyline inside a certain block?
To delete all polylines inside all blocks, including the layouts, you interate all objects in all blockdefinitions and see if they're polylines:
[<Autodesk.AutoCAD.Runtime.CommandMethod "DELPOLYS">]
let DelPolys() =
let doc = Application.DocumentManager.MdiActiveDocument
use tr = doc.Database.TransactionManager.StartTransaction()
let bt = doc.Database.BlockTableId.GetObject OpenMode.ForRead :?> BlockTable
for btroid in bt do
let btr = btroid.GetObject OpenMode.ForRead :?> BlockTableRecord
for oid in btr do
match oid.GetObject OpenMode.ForRead with
| :? Polyline as pl ->
pl.UpgradeOpen()
pl.Erase()
| _ -> ()
tr.Commit()
The alternative interpretation is that you want to trim your polyline between the intersection points of it with some or all of the blocks elements, in which case more information is needed: how would I identify a certain polyline which intersects with certain elements inside a certain block? And why don't you just create a wipeout to achieve the same result?