rotating region

Discussion in 'AutoCAD' started by robert vetrano, Jul 7, 2004.

  1. Hi
    I am trying to rotate a region I created but keep getting an error 'object
    required ' #424. If I extrude the region then I can rotate it. I want to
    rotate before I extrude. I am fairly new to VBA and would appreciate any
    help.

    Thanks
    Bob Vetrano
     
    robert vetrano, Jul 7, 2004
    #1
  2. robert vetrano

    john m Guest

    usually i get that error if i didnt use the "set" command
    like

    set objRegion = however you get the region
    instead of just
    objRegion=however you get it

    hope that helps

    jm
     
    john m, Jul 7, 2004
    #2
  3. John
    I tried that. I declared the region as variant and when I use Set I get an
    error type mismatch.

    thanks
    Bob v
     
    robert vetrano, Jul 7, 2004
    #3
  4. robert vetrano

    john m Guest

    my book here has a program to add revolved solid from a rotated region
    dont know if this is what you are tryin to do
    but their program does use a variant variable to hold the region
    in which case you wouldnt use set

    must just be something about the syntax

    JM

    ps the book is called acad2000vba by joe sutphin
     
    john m, Jul 7, 2004
    #4
  5. robert vetrano

    Jürg Menzi Guest

    Hi Bob

    From the VBA Reference:

    Object.Rotate BasePoint, RotationAngle

    Object
    All Drawing Objects, AttributeReference
    The object or objects this method applies to.
    (...)

    Therefore the Rotate method requires an object not a variant:
    <snip>
    Dim TmpObj As AcadEntity
    Dim TmpPnt As Variant

    ThisDrawing.Utility.GetEntity TmpObj, TmpPnt, vbCrLf & "Select Region: "
    TmpObj.Rotate TmpPnt, 0.7853981 '45 degrees
    <snip>

    Cheers
     
    Jürg Menzi, Jul 7, 2004
    #5
  6. robert vetrano

    Dan Cannon Guest

    I would suggest that, instead of using a variant, you use an object; i.e.:

    Dim objRegion As AcadObject
    Set objRegion = ...
     
    Dan Cannon, Jul 8, 2004
    #6
  7. Thanks for everyones help.

    bob Vetrano
     
    robert vetrano, Jul 11, 2004
    #7
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.