Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Filter a UCS

  1. #1
    Join Date
    Feb 2004
    Location
    Oud Gastel, The Netherlands
    Posts
    359

    Filter a UCS

    i have next code:

    Code:
    Dim varpick As Variant
    Dim outerLoop() As AcadEntity
    Dim IsItClosed As AcadLWPolyline
    
    With ThisDrawing.Utility
    ReDim outerLoop(0)
    .GetEntity outerLoop(0), varpick, vbCr & "Select area to hatch: "
    If outerLoop(0) Is Nothing Then
    .Prompt vbCrLf & "No BOUNDARY was selected"
    Exit Sub
    End If
    End With
    
    
    hatchObj.AppendOuterLoop (outerLoop)
    hatchObj.Evaluate
    ZoomExtents
    Now how can i make ths ucs of outerloop(0) current ??

  2. #2
    Join Date
    Mar 2004
    Location
    Brisbane, Australia
    Posts
    858
    You have to define a new ucs origin with something like this..

    ' Create a new UCS with origin 2, 2, 0
    Dim ucsObj As AcadUCS
    Dim origin(0 To 2) As Double
    Dim xAxisPoint(0 To 2) As Double
    Dim yAxisPoint(0 To 2) As Double

    origin(0) = 2: origin(1) = 2: origin(2) = 0
    xAxisPoint(0) = 3: xAxisPoint(1) = 2: xAxisPoint(2) = 0
    yAxisPoint(0) = 2: yAxisPoint(1) = 3: yAxisPoint(2) = 0

    But you'll need to refer to the pline startpoint.

    Dim plineObj As AcadPolyline
    Dim coord As Variant
    coord = plineObj.Coordinate(0)

    So that the origin is set by

    origin(0) = coord(0): origin(1) = coord(1): origin(2) = coord(2)

    The X and Y are to determine rotation of the UCS if required.

    Hope this helps.

  3. #3
    Join Date
    Feb 2004
    Location
    Oud Gastel, The Netherlands
    Posts
    359

    ..

    Sorry eddie

    but i dont get it ..
    where did the
    Dim ucsObj As AcadUCS
    go ??

    Now i have this:

    Code:
    Dim UcsObj As AcadLine
    Dim UCSbasePnt As Variant
    
    Set UcsObj = Nothing
    
    ThisDrawing.Utility.GetEntity UcsObj, UCSbasePnt, vbCr & "Select line whit the correct hatch angle:"
    While ssObj.ObjectName <> "AcDbLine"
        MsgBox "Select a line ..."
        ThisDrawing.Utility.GetEntity UcsObj, UCSbasePnt, vbCr & "Select line whit the correct hatch angle:"
    Wend
    Now, i want the ucs become the same as UcsObj.Angle ..

    how how how

  4. #4
    Join Date
    Mar 2004
    Location
    Brisbane, Australia
    Posts
    858
    I must have misuderstood what you wanted....
    Did you want to set the UCS to the pline location or get the PLINE co-ordinates ?

  5. #5
    Join Date
    Feb 2004
    Location
    Oud Gastel, The Netherlands
    Posts
    359

    ..

    i want to set the ucs :P :?: :!: :idea:

    or ...

    how can i pause VBA for input ??
    Then i could use:

    (thisdrawing. sendcommand "UCS" & vbCr & "ob" & vbCR)

    but now it just goes on and i cannot select the line ...

  6. #6
    Join Date
    Mar 2004
    Location
    Brisbane, Australia
    Posts
    858
    But if you are already selecting the line for the hatching then all you need to do is pass on the coordinates of pline to ucs

  7. #7
    Join Date
    Feb 2004
    Location
    Oud Gastel, The Netherlands
    Posts
    359

    ..

    I selected it with the outerloop(0)


    Now tell me, how to set a ucs from it.

    i dont know

  8. #8
    Join Date
    Mar 2004
    Location
    Brisbane, Australia
    Posts
    858
    8) It's on the second post up top....
    the ucs origins = the pline coords.

  9. #9
    Join Date
    Feb 2004
    Location
    Oud Gastel, The Netherlands
    Posts
    359

    uhhh

    eddie, you saw my file ...
    now i can select a pline to hatch an hatcharea....
    but what if there is a text in the area ? I want it not to hatch !!

  10. #10
    Join Date
    Mar 2004
    Location
    Brisbane, Australia
    Posts
    858
    8) Then you'll have to check the hatch settings "ISLAND DETECTION"

    ' Set the hatch style to normal
    hatchObj.hatchstyle = acHatchStyleNormal

    I'll have a play with the code tonight and see what I come up with..

Page 1 of 2 12 LastLast

Posting Permissions

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