Results 1 to 3 of 3

Thread: Object in which space in ActiveX method !

  1. #1
    Member rajat_bapi_mallick's Avatar
    Join Date
    2005-08
    Location
    Kolkata, INDIA
    Posts
    40
    Login to Give a bone
    0

    Talking Object in which space in ActiveX method !

    Hi !

    How do I know that an object is laying on "model space" or "paper space" in ActiveX method ?

    Thanks,

    Rajat
    INDIA

  2. #2
    100 Club CADmium's Avatar
    Join Date
    2004-08
    Location
    Eberswalde, Germany, Europe
    Posts
    128
    Login to Give a bone
    0

    Default Re: Object in which space in ActiveX method !

    try for example this code:
    Code:
    (defun GETOWNERSPACE (OBJ / OBJLAYOUT NAME OWNER)
      (if(and(setq OBJ(cond 
                        ((=(type OBJ) 'VLA-OBJECT) OBJ)                       
                        ((=(type OBJ) 'Ename)(vlax-ename->vla-object OBJ))
                      )
             )
             (not(vl-catch-all-error-p
                   (setq OWNER(vl-catch-all-apply
                                'vlax-invoke-method
                                 (list
                                   (vla-get-ActiveDocument(vlax-get-acad-object))
                                   'ObjectIdToObject
                                   (vla-get-ownerid OBJ)
                                 )
                              )
                   )
                 )
             )     
             (setq NAME(vla-get-name OWNER))
         )
         (if(not(vl-catch-all-error-p
                   (setq OBJLAYOUT(vl-catch-all-apply
                                    'vla-get-layout
                                     (list OWNER)
                                  )
                   )
                )
            )    
           (list NAME  "= LAYOUT" (vla-get-name OBJLAYOUT))  
           (list NAME  "BLOCK")
         )
      )
    )
    call : (GETOWNERSPACE (car(entsel)))

    you can also modify the returns..

  3. #3
    AUGI Addict fixo's Avatar
    Join Date
    2005-05
    Location
    Pietari, Venäjä
    Posts
    1,269
    Login to Give a bone
    0

    Default Re: Object in which space in ActiveX method !

    Quote Originally Posted by rajat_bapi_mallick
    Hi !

    How do I know that an object is laying on "model space" or "paper space" in ActiveX method ?

    Thanks,

    Rajat
    INDIA
    Hi Rajat

    Or give this a try:

    Code:
    (defun demo-tab-test	(obj / adoc check obj)
      (vl-load-com)
      (or adoc
          (setq adoc (vla-get-activedocument
    		   (vlax-get-acad-object)
    		 )
          )
      )
      (and obj
           (not (vl-catch-all-error-p
    	      (setq check
    		     (vl-catch-all-apply
    		       (function (lambda ()
    				   (vla-get-taborder
    				     (vla-get-layout
    				       (vla-objectIdtoobject
    					 adoc
    					 (vla-get-ownerID obj)
    				       )
    				     )
    				   )
    				 )
    		       )
    		     )
    	      )
    	    )
           )
      )
      (if (zerop check)
        (alert "Model")
        (alert "Paper")
      )
    )
    
    ; CaLL :
    (demo-tab-test  (vlax-ename->vla-object
          (car (entsel
    	"\n >> Select object \n"))))

Similar Threads

  1. ActiveX component can't create object
    By jkp in forum VBA/COM Interop
    Replies: 3
    Last Post: 2014-11-19, 08:50 PM
  2. get boundary using Activex method
    By rajat_bapi_mallick in forum AutoLISP
    Replies: 4
    Last Post: 2009-01-07, 12:24 PM
  3. Fix the VLISP/ActiveX object-management bug
    By sinc in forum API Wish List
    Replies: 2
    Last Post: 2004-09-21, 08:10 PM
  4. Purge a particular item by using ActiveX method
    By rajat126 in forum AutoLISP
    Replies: 1
    Last Post: 2004-06-19, 06:42 PM
  5. "AngleToReal" in ActiveX method
    By rajat126 in forum AutoLISP
    Replies: 1
    Last Post: 2004-06-15, 01:01 PM

Posting Permissions

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