Results 1 to 5 of 5

Thread: Sectioning Solids

  1. #1
    Active Member
    Join Date
    2007-12
    Posts
    68

    Default Sectioning Solids

    Ive looked everywhere. The autocad help is missing some, or all, of the info that is needed

    I want to generate sections from 3d models, hopefully using VBA. Im not proficient in lisp, but will do what is necessary to get this done.

    Im hoping to get not only the profiles of the solids sectioned at a particular plane/location, but also unsectioned geometry from solids just 'out of range' of the plane section. (background, etc)

    Ive already tried/tweaked the "SectionSolid" call; but it only returns the geometry directly thru the section, and none of the unsectioned background objects. However, I think I can use the fact that the region comes back as an empty object to tell me that the offending solid is NOT intersecting, so that maybe I can also use 'GenerateSectionGeometry ' call to get just the background geometry, which I also need.

    The docs for GenerateSectionGeometry are sparse; Ive seen nothing on different web searches. I have a few questions that may help get the ball rolling here. Id appreciate *any* insight into these problems:


    1) The section Object itself: I tried usinn the "AddSection" method,
    unsuccessfully. What is the plane vector? How do I format it?

    2) I skipped by that and attempted to use the GenerateSectionGeometry call from an existing section plane made manually in a drawing. The help states the "pEntity" param is an "entity" - which entity? The solid that has to be sectioned? That returns an
    error. A Block, like AddSection requires ? A blockRef? (remember, the manual version of this call also returns geometry in a block), so i tried both blocks, and blockrefs - nogo.

    Or maybe theres another way? A way I can get the culled profiles, of non-intersecting geometry from solids ? Then I can use the sectionsolid call, with the geometry formatting libs I just wrote.

    ???

  2. #2
    Member
    Join Date
    2007-01
    Posts
    14

    Default Re: Sectioning Solids

    I AM STUCK ON THIS AS WELL
    MY TACK AT THE MOMENT IS TO RUN THE COMMANDS FROM THE
    COMAND LINE eg. SECTIONPLANE
    AND THEM TRAP THEM IN ENDCOMMANDS EVENT
    AND THEN INSPECT THE AcDBSection object etc to see if I can make sense of it.

  3. #3
    Member
    Join Date
    2007-01
    Posts
    14

    Default Re: Sectioning Solids

    AND OBJECTADDED

  4. #4
    Member
    Join Date
    2007-01
    Posts
    14

    Default Re: Sectioning Solids

    TRAPPING THE COMMAND I FOUND THE refPLANE was a SIMPLE 0,0,1 type Variant.

    So CODED this:
    If TestNbr = "90" Then
    Dim myBlock As AcadBlock
    PT1v = PickPoint("Point 1") ' pts either side of the solid
    PT2v = PickPoint("Point 2")
    Call PTv_Assign(PT3v, 0, 1, 0) ' wcs Y Axis for me
    Dim section As AcadSection
    Set myBlock = ThisDrawing.Blocks.Add(PT1v, "SectionBlock")
    Set section = myBlock.AddSection(PT1v, PT2v, PT3v)
    Set Obj = PickObject("Pick Object") ' the solid
    Dim v1 As Variant, v2 As Variant, v3 As Variant, v4 As Variant, v5 As Variant
    Call section.GenerateSectionGeometry(Obj, v1, v2, v3, v4, v5)
    ' v1 IntersectionBoundaryObjs - the 2d section ?
    For i = 0 To UBound(v1)
    Set Obj = v1(i)
    If Obj.ObjectName = "AcDbLine" Then
    Set l = Obj
    l.Color = acGreen
    l.Update
    H = l.Handle
    End If
    Next i

    End If

    Add it all seems ok - doesn't crash.

    BUT...
    I can't see anything - the l lineobject above is invisble.
    Grrrr

  5. #5
    All AUGI, all the time arshiel88's Avatar
    Join Date
    2005-02
    Location
    Off the Grid
    Posts
    548

    Default Re: Sectioning Solids

    Try this.

    Code:
    Sub GenSection()
    Dim x3DSolid As Acad3DSolid
    ThisDrawing.Utility.GetEntity x3DSolid, basePt, "Pick 3D Solid"
    
    Dim PlaneVector(0 To 2) As Double
    PlaneVector(0) = 0: PlaneVector(1) = 0: PlaneVector(2) = 1
    pt1 = ThisDrawing.Utility.GetPoint(, "Pick first point")
    pt2 = ThisDrawing.Utility.GetPoint(, "Pick end point")
    Dim sec As AcadSection
    
    Dim ss As AcadSectionSettings
    
    Set sec = ThisDrawing.ModelSpace.AddSection(pt1, pt2, PlaneVector)
    With sec
    .TopHeight = 3
    .BottomHeight = 1
    .State = acSectionStatePlane
    Set ss = .Settings
    End With
    
    With ss
    .CurrentSectionType = acSectionType2dSection
    End With
    
    Dim acSectionTypeSettings As AcadSectionTypeSettings
    Set acSectionTypeSettings = ss.GetSectionTypeSettings(acSectionType2dSection)
    With acSectionTypeSettings
    .ForegroundLinesVisible = True
    .BackgroundLinesHiddenLine = True
    .IntersectionFillHatchPatternName = "ANSI31"
    'and other settings
    End With
    
    sec.GenerateSectionGeometry x3DSolid, BoundaryObjs, FillObjs, BakcGroundObjs, ForegroundObjs, CurveTangencyObjs
    
    End Sub
    BoundaryObjs receives the boundary lines, FillObjs receives the fills (hatch), and so on.

    PS: use "[code]" tags

    Shielbern Bolalin
    Architectural 3D Renderer
    ----------------------------------------------------------------------
    “A clever person solves a problem. A wise person avoids it.”

    1879-1955

Similar Threads

  1. Sectioning
    By wpeacock in forum Inventor - General
    Replies: 2
    Last Post: 2011-11-16, 11:01 PM
  2. Sectioning in Manage 2011
    By jbaumann in forum NavisWorks - General
    Replies: 1
    Last Post: 2010-06-11, 06:31 PM
  3. Sectioning and Viewpoints
    By Carlos_G in forum NavisWorks - General
    Replies: 2
    Last Post: 2010-03-24, 10:30 PM
  4. Sectioning Problems
    By theald in forum NavisWorks - General
    Replies: 0
    Last Post: 2009-06-29, 04:51 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •