Author Topic: entmod viewport.  (Read 4739 times)

0 Members and 1 Guest are viewing this topic.

Amsterdammed

  • Guest
entmod viewport.
« on: March 10, 2006, 07:38:18 AM »
Hi everybody,

In the Online Help they say

Quote
You cannot use the entmod function to modify a viewport entity

Can I entmake a viewport? I always get nil back instead of  the vp

Thanks in advance,

Bernd

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: entmod viewport.
« Reply #1 on: March 10, 2006, 07:51:28 AM »
From Help
Quote
Notes on Using entmake

You cannot create viewport objects with entmake.

Have a look at vla-AddPViewport
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Amsterdammed

  • Guest
Re: entmod viewport.
« Reply #2 on: March 10, 2006, 10:01:19 AM »
Thanks Kerry  :-)

There is nothing about it in my Acad Help

found that in Google

http://intervision.hjem.wanadoo.dk/vla/addpviewport.htm
Bernd

Jeff_M

  • King Gator
  • Posts: 4100
  • C3D user & customizer
Re: entmod viewport.
« Reply #3 on: March 10, 2006, 01:14:17 PM »
Bernd,
The help for ActiveX methods and properties is "ActiveX and VBA Reference". For a great description of how to implement them, grab David M. Stein's "The Visual Lisp Developer's Bible" from HERE

Using Activex you can not only add a viewport, but modifying them is a piece of cake, too, unlike the (entmake) & (entmod) counterparts.......

Amsterdammed

  • Guest
Re: entmod viewport.
« Reply #4 on: March 12, 2006, 05:08:45 AM »
Thanks Jeff :-)

FengK

  • Guest
Re: entmod viewport.
« Reply #5 on: March 13, 2006, 12:55:09 AM »
Add to Jeff's reply.  The help file for activex is acadauto.chm under dir C:\Program Files\AutoCAD 200(#)\Help
But I usually use acad_dev.chm also includes reference material for autolisp, dxf, ssm, etc.  I wrote a short lisp to open this file.  You'll need to add the help directory to support paths.
(defun C:REF ()
  (dos_shellexe
    (findfile "acad_dev.chm")
    nil
  )
  (princ)
)



Amsterdammed

  • Guest
Re: entmod viewport.
« Reply #6 on: March 14, 2006, 03:05:09 AM »
Quote
ref no function definition: DOS_SHELLEXE; reset after error
is what i get when running your code, Kelie

Bernd

Serge J. Gianolla

  • Guest
Re: entmod viewport.
« Reply #7 on: March 14, 2006, 03:17:07 AM »
Bernd, you need DosLib from Robert mcneel

Serge J. Gianolla

  • Guest
Re: entmod viewport.
« Reply #8 on: March 14, 2006, 03:18:24 AM »
Forgot to mention it is a free arx!

Jürg Menzi

  • Swamp Rat
  • Posts: 599
  • Oberegg, Switzerland
Re: entmod viewport.
« Reply #9 on: March 14, 2006, 05:07:25 AM »
Or w/o DOSLib:
Code: [Select]
(defun C:CallDevHelp ( / HlpFil)
 (if (setq HlpFil (findfile "acad_dev.chm"))
  (startapp "hh.exe" (strcat "ms-its:" HlpFil "::/1aag.html"))
 )
 (princ)
)
A computer's human touch is its unscrupulousness!
MENZI ENGINEERING GmbH
Current A2k16... A2k24 - Start R2.18

Andrea

  • Water Moccasin
  • Posts: 2372
Re: entmod viewport.
« Reply #10 on: March 15, 2006, 08:19:41 AM »
simple question....

why need entmake to create a vport ?

also..i have found something about adding Xdata in a viewport
(was modified for my use...)
but maybe this can help..

Code: [Select]
(defun c:xd(/ ent sel txts typex valeur)
  (princ "\n Please select the VIEWPORT :")
  (if (setq sel (ssget "_+.:E:s" '((0 . "VIEWPORT"))))
    (progn
      (vl-load-com)
      (setq ent (vlax-ename->vla-object (ssname sel 0)))
      (setq typex  (vlax-make-safearray vlax-vbInteger (cons 0 1))
                    Valeur (vlax-make-safearray vlax-vbVariant (cons 0 1)))
      (vlax-safearray-put-element typex 0 1001)
      (vlax-safearray-put-element valeur 0 "ANDREA")
      (vlax-safearray-put-element typex   1 1000)
      (vlax-safearray-put-element valeur 1 "TEST")
      (setq typex  (vlax-make-variant typex)
            valeur (vlax-make-variant valeur))
      (vla-setxdata ent typex valeur)
      ; et maintenant, je récupere les xdata
      (vla-getxdata ent "ANDREA" 'typex 'valeur)
      (setq txt (vlax-variant-value (nth 1 (vlax-safearray->list valeur))))
      (princ (strcat "\nLe The xdata of the viewport \"ANDREA\" is " txt))
    )
  )
  (princ)
)
« Last Edit: March 15, 2006, 08:25:31 AM by Andrea »
Keep smile...

Amsterdammed

  • Guest
Re: entmod viewport.
« Reply #11 on: March 26, 2006, 07:00:00 AM »
 :-)Thanks all

Bernd