Check interference method with blocks

Discussion in 'AutoCAD' started by Asty, Mar 13, 2007.

  1. Asty

    Asty Guest

    Hi all,
    My drawing contains different types of object (like 3D Solids, Blocks,
    line, rectangles..etc.) I want to check the interference for objects
    in a selectionset with all other object of the drawing. I am not sure
    if this method works with objects other than 3d solids. How should I
    proceed with this?

    Will the intersect method work for me?


    Here is the piece of code I have written..Suggest me where i am going
    wrong..
    Public Sub interfencecheck()

    Dim i As Integer
    Dim siteobj() As Acad3DSolid
    Dim No_on_site As Integer, j As Integer

    No_on_site = ThisDrawing.ModelSpace.Count -
    Module_startup.ssetbase.Count

    ReDim siteobj(0 To No_on_site)

    For i = 0 To ThisDrawing.ModelSpace.Count - 1
    If ThisDrawing.ModelSpace.Item(i).ObjectName =
    "AcDbBlockReference" Then
    Set blk = ThisDrawing.ModelSpace.Item(i)
    If blk.EffectiveName = "CabinS" Or blk.EffectiveName =
    "Boom" _
    Or blk.EffectiveName = "Hookblock" Or blk.EffectiveName =
    "Mast" _
    Or blk.EffectiveName = "BoomAxis" Or blk.EffectiveName =
    "LuffAxis" Then
    GoTo Label1
    End If
    Set blk = Nothing
    End If
    If TypeOf ThisDrawing.ModelSpace.Item(i) Is Acad3DSolid Then

    Set siteobj(j) = ThisDrawing.ModelSpace.Item(i)
    siteobj(j).Highlight True
    MsgBox " object name is : " & siteobj(j).ObjectName

    j = j + 1

    Else
    If TypeOf ThisDrawing.ModelSpace.Item(i) Is AcadLineType
    Then
    Set siteobj(j) = ThisDrawing.ModelSpace.Item(i)
    j = j + 1
    End If
    End If

    Label1:
    Next i

    MsgBox UBound(siteobj)
    On Error Resume Next
    For i = 0 To UBound(siteobj)
    If TypeOf siteobj(i) Is Acad3DSolid Then
    For j = 0 To Module_startup.ssetbase.Count - 1
    Dim solidObj As Acad3DSolid

    Set solidObj =
    siteobj(i).CheckInterference(Module_startup.ssetbase(j), True)
    If solidObj.Volume <> 0 Then

    siteobj(i).Highlight True
    MsgBox " ONE INTERFERENCE IS DETECTED "
    solidObj.Delete
    End If
    Next j
    End If
    If (TypeOf siteobj(i) Is AcadSolid) = False Then
    '****************************************
    'What should I do here?
    '****************************************
    End If
    Next i
    End Sub



    My second question-
    I have some information to display all the time in the AutoCAD session
    for ex:- some text , dimension measurements..(in a label)..and also i
    need to update them... What method can i go with?

    Please Guide me with this problem.

    Thanks for all who cares..

    Asty
     
    Asty, Mar 13, 2007
    #1
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.