Results 1 to 5 of 5

Thread: ActiveX Question ....?

  1. #1
    I could stop if I wanted to
    Join Date
    2015-09
    Posts
    420
    Login to Give a bone
    0

    Default ActiveX Question ....?

    AUGI Members,

    I am new to ActiveX programming and trying to develop a routine. At the moment I have this piece of code to create something in Model Space.

    Code:
      (vl-load-com)
    
      (setq	*thisdrawing* (vla-get-activedocument
    			(vlax-get-acad-object)
    		      ) ;_ end of vla-get-activedocument
    	*modelspace*  (vla-get-ModelSpace *thisdrawing*)
    	*utility*     (vla-get-Utility *thisdrawing*)
      ) ;_ end of setq
      (setq	ssets	  (vla-get-selectionsets *thisdrawing*)
    	ssetcount (vla-get-count ssets)
      ) ;_ end of setq
    What would the code look like to do something in Paper Space....??


    Regards,
    Vince

  2. #2
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,779
    Login to Give a bone
    0

    Default Re: ActiveX Question ....?

    Code:
    
    
    ;;; create a reference to ps
    (setq *ps* (vla-get-PaperSpace *thisdrawing*))
    
    ;;; draw a line
    (vla-addLine *ps*
      (vlax-3d-point (list 0.0 0.0 0.0))
      (vlax-3d-point (list 8.0 5.0 0.0))
    )  
    
    
    R.K. McSwain | CAD Panacea |

  3. #3
    AUGI Addict alanjt's Avatar
    Join Date
    2008-02
    Posts
    1,141
    Login to Give a bone
    0

    Default Re: ActiveX Question ....?

    I use this...

    Code:
    ;;; Defined ActiveSpace for vl* functions
    ;;; Alan J. Thompson
    (defun AT:ActiveSpace (/)
      (or *AcadDoc* (setq *AcadDoc* (vla-get-activedocument (vlax-get-acad-object))))
      (if (or (eq acmodelspace (vla-get-activespace *AcadDoc*))
              (eq :vlax-true (vla-get-mspace *AcadDoc*))
          ) ;_ or
        (vla-get-modelspace *AcadDoc*)
        (vla-get-paperspace *AcadDoc*)
      ) ;_ if
    ) ;_ defun

  4. #4
    I could stop if I wanted to
    Join Date
    2015-09
    Posts
    420
    Login to Give a bone
    0

    Default Re: ActiveX Question ....?

    Hi Alan,

    Thank you for your response......however, with my inexperience with ActiveX, I can not get your code to run. tried to replace the code strings I had with yours and got the following error:

    Error: bad argument type: VLA-OBJECT nil

    Any suggestions....??

    Thanks again for you help...!


    Regards,
    Vince

  5. #5
    AUGI Addict alanjt's Avatar
    Join Date
    2008-02
    Posts
    1,141
    Login to Give a bone
    0

    Default Re: ActiveX Question ....?

    Quote Originally Posted by vferrara View Post
    Hi Alan,

    Thank you for your response......however, with my inexperience with ActiveX, I can not get your code to run. tried to replace the code strings I had with yours and got the following error:

    Error: bad argument type: VLA-OBJECT nil

    Any suggestions....??

    Thanks again for you help...!


    Regards,
    Vince


    I always define the Active Document with
    *AcadDoc*. Either use that, or change to what you are using.
    I only define it once, then leave it as a global variable.

Similar Threads

  1. Navisworks Activex for IE 10
    By shridhar355157 in forum Dot Net API
    Replies: 0
    Last Post: 2013-01-31, 01:08 AM
  2. ActiveX question - Library not registered
    By Pierre Marcotte in forum AutoLISP
    Replies: 4
    Last Post: 2012-08-30, 12:50 PM
  3. ActiveX error
    By d_m_hopper in forum AutoLISP
    Replies: 1
    Last Post: 2010-08-05, 04:26 PM
  4. ActiveX Error Help....?
    By CADdancer in forum AutoLISP
    Replies: 3
    Last Post: 2010-04-05, 04:17 PM
  5. ActiveX для IE
    By sapr.220168 in forum Русский - Документооборот и Управление инженерными данными
    Replies: 0
    Last Post: 2010-02-16, 12:17 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
  •