help with setview...

Discussion in 'AutoCAD' started by Devin, Jan 27, 2004.

  1. Devin

    Devin Guest

    I'm trying to set a view active in a pviewport, my syntax is:

    (vla-setview <pviewport-object> <view-object>)

    But I keep getting the error:

    ActiveX Server returned the error: unknown name: SetView

    Any ideas?

    Devin
     
    Devin, Jan 27, 2004
    #1
  2. Devin

    Devin Guest

    Hi Luis (note: I don't speak Spanish, but perhaps I should as I live in San
    Diego)

    I still can't get it to work. I pass a pviewport object and a view object
    and I still get an error. Do you know what I am doing wrong?

    Devin
     
    Devin, Jan 27, 2004
    #2
  3. :) I am in San Diego too (downtown)

    what your code looks like?
     
    Luis Esquivel, Jan 27, 2004
    #3
  4. Devin

    Devin Guest

    :) I am in San Diego too (downtown)

    Small world!

    ;pspace = paperspace object
    ;views = views collection
    ;name = view name string
    ;note that it all works till I get to vla-setview then it crashes

    (setq
    viewport (vla-addPViewport pspace (vlax-3d-point (list 4.08196 5.44773
    0.0)) 8.035845 7.866784)
    view (vla-item views name)
    )
    (vla-setview viewport view)
     
    Devin, Jan 27, 2004
    #4
  5. if i use my functions works

    i.e.
    (set-viewname "TEST")

    try by setting the viewport to active with: vla-put-activepviewport
     
    Luis Esquivel, Jan 27, 2004
    #5
  6. Devin

    Devin Guest

    Thanks for your help Luis. I must be missing something. I'm still getting
    an error just trying to set the activePViewport...

    Command: !curdoc
    #<VLA-OBJECT IAcadDocument 00fc74f0>;the doc is active

    Command: (setq obj (vlax-ename->vla-object (car (entsel))))

    Select object: #<VLA-OBJECT IAcadPViewport 0732f494>


    Command: (vla-put-activepviewport curdoc obj)
    Automation Error. Error setting current viewport

    Devin
     
    Devin, Jan 28, 2004
    #6
  7. Devin

    ECCAD Guest

    Maybe you two guys should meet for lunch (with laptops in hand). :)
    Bob
     
    ECCAD, Jan 28, 2004
    #7
  8. Devin

    Mark Propst Guest

    (setq obj (vlax-ename->vla-object (car (entsel))))
    (vla-put-MSpace curdoc :vlax-true)
    (vla-put-activepviewport curdoc obj)

    hth
    mark
     
    Mark Propst, Jan 28, 2004
    #8
  9. Devin

    Devin Guest

    Sounds great! I live in the El Cajon area.
     
    Devin, Jan 28, 2004
    #9
  10. There you go...

    Bob,

    I have a bad habit of always trying to give to others what I think I know,
    in this case vlisp source code or legacy lisp, etc.
    If you want, you can join us - I will be at 12th and C downtown SD, at noon
    the next February 30th. 2004 :)

    Since now that habit has become an addiction, I have plans to quit and
    tomorrow is my last day.

    Regards,
    Luis.
     
    Luis Esquivel, Jan 28, 2004
    #10
  11. Devin,

    I think you have my email address, if you need any other assistance please
    send me an email.

    BTW, I have tried your sample and in my computer works.

    Remember that views are saved in their own location, notice my function:
    view-set-location

    Hope it makes any sense

    Luis.
     
    Luis Esquivel, Jan 28, 2004
    #11
  12. Devin

    Mark Propst Guest

    just curious, did my solution work for you?
     
    Mark Propst, Jan 28, 2004
    #12
  13. Devin

    Devin Guest

    Yes it did work without error, thanks Mark.

    Devin
     
    Devin, Jan 28, 2004
    #13
  14. Devin

    Devin Guest

    I have to get some work done, but I'm going to figure this out! I'll
    examine your code a little closer, I'm sure it's something simple that I'm
    missing.

    Thanks,

    Devin
     
    Devin, Jan 28, 2004
    #14
  15. Devin

    Mark Propst Guest

    cool
    :)~
     
    Mark Propst, Jan 28, 2004
    #15
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.