.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Delete revision cloud

3 REPLIES 3
Reply
Message 1 of 4
wang890
3732 Views, 3 Replies

Delete revision cloud

i am trying to delete the revision cloud in many drawings.

here's what the revision cloud is like:

1. on all kinda of layers
2. radius for arcs vary
3. lengths vary
4. could be in model space, or could be in paper space

the only way i can think about to pin down this object is by confirming all entities on the polyline are arcs. also what can also help is since 99% of the revision cloud we draw are cyan colour (those who use other colour are retarded, because it's the rule). i can test whether the layer it reside on is cyan, also some people force the colour of the object when it is on layer 0. so that will also help to distinguish the object.

so the plan is:

1. test number of arcs, has to be all arcs
2. check layer is cyan or bycolour is cyan
3. ideally go through paper space, then look just the objects in the models space which fall under each viewport, this sounds difficult because what if the rev cloud is on 2 pages? so scratch this one.

any new project i am going to tell people put rev cloud on a unique layer and keep it consistant. so we don't run into this trouble next time. and, there will always be people who doesn't follow the rules.

Anybody have code example or recommendations to get started on that?
Stantec
Dell Precision 5530, Prism M320PU, C3D 14/17/19
3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: wang890


How about testing the start / end points?  If
the endpoint of an arc is the same as the start point of another arc, its a
revcloud.  Are they closed?

 
Message 3 of 4
wang890
in reply to: wang890

here's something i came up with, actually some retards somehow broke some of the rev cloud. so yeah, they are not all closed. but there are always other closed polylines in the database, can't assume this is false.


Dim BTR_Layout As BlockTableRecord = CType(trans.GetObject(oLayout.BlockTableRecordId, OpenMode.ForWrite), BlockTableRecord)

For Each id As ObjectId In BTR_Layout
Dim entBlock As DBObject = CType(trans.GetObject(id, OpenMode.ForRead), DBObject)
Dim DXF_Name As String = entBlock.GetRXClass.DxfName.ToUpper
If DXF_Name = "LWPOLYLINE" Then
entBlock = CType(trans.GetObject(id, OpenMode.ForWrite), DBObject)
Dim bIsRevisionCloud As Boolean = True
Dim oPolyline As Polyline = CType(entBlock, Polyline)

For i As Integer = 0 To oPolyline.NumberOfVertices - 1
Select Case oPolyline.GetSegmentType(i)
Case SegmentType.Arc
'do nothing
Case SegmentType.Line
bIsRevisionCloud = False
End Select
Next

'delete object if it is rev cloud
If bIsRevisionCloud = True Then
entBlock.Erase()
End If

End If
Next
Stantec
Dell Precision 5530, Prism M320PU, C3D 14/17/19
Message 4 of 4
haribaburam
in reply to: wang890

Hi,

 

Could you let me know on how to run this code in AutoCAD.....

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost