AddPviewport

Discussion in 'AutoCAD' started by Gustavo Guidi, Sep 23, 2004.

  1. Why does AutoCAD tell me Too few arguments ?

    (defun vlxx-AddPViewport
    (ctrPt dblwidth dblheight strLayer / lst obj)

    (setq obj
    (vla-AddPViewport
    (vla-get-PaperSpace)
    (vlax-3D-Point ctrPt)
    dblwidth
    dblheight
    )
    )
    (if strLayer (vla-Put-Layer obj strLayer))
    (vla-Update obj)
    (vlax-Release-Object obj)

    )


    Thanks
     
    Gustavo Guidi, Sep 23, 2004
    #1
  2. Gustavo Guidi

    SpeedCAD Guest

    Hi...

    You have problem in the line (vla-get-paperspace). First you must do reference the ACAD object.

    (defun vlxx-AddPViewport
    (ctrpt dblwidth dblheight strLayer / PViewport)
    (if (= (vla-get-activespace
    (vla-get-activedocument (vlax-get-acad-object))
    )
    acModelSpace
    )
    (vla-put-activespace
    (vla-get-activedocument (vlax-get-acad-object))
    acPaperSpace
    )
    )
    (setq PViewport (vla-addpviewport
    (vla-get-paperspace
    (vla-get-activedocument (vlax-get-acad-object))
    )
    (vlax-3d-point ctrpt)
    dblwidth
    dblheight
    )
    )
    (if strLayer
    (vla-put-layer PViewport strLayer)
    )
    ) ;_defun

    (vlxx-addpviewport (getpoint "\nPunto: ") 420 297 nil)

    Un saludo de SpeedCAD... :D
    CHILE
    FORO: http://www.hispacad.com/foro
     
    SpeedCAD, Sep 23, 2004
    #2
  3. Thanks (I haven't prove it yet), but why do you include 4 arguments while
    the function in VBA ask for only for : center_point width an height .
    What's the nil for?

    Thanks again
     
    Gustavo Guidi, Sep 24, 2004
    #3
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.
Similar Threads
Loading...