Results 1 to 2 of 2

Thread: vla-addLightweightPolyline PaperSpace/Layout

  1. #1
    I could stop if I wanted to pnorman's Avatar
    Join Date
    2005-02
    Location
    Calgary
    Posts
    203
    Login to Give a bone
    0

    Question vla-addLightweightPolyline PaperSpace/Layout

    Please help...

    How do I tell vla-addLightweightPolyline which paper space layout to draw the polyline in. I want to add the pl in the current layout regardless of whether its "Model" or one of multiple p/s layouts.

    The code below only puts the polyline in the first paper space layout regardless of which p/s layout is actually current.
    What am I missing?
    Do I need to add the polyline and then change its layout property using vla-put- or is there an easier way to tell vla-addL.... which layout is current?

    The second p/s code fragment below doesn't work at all!!
    (the model space works fine in all cases)

    Code:
      (if (= (getvar "CTAB") "Model")
    	(setq OBJ (vla-addLightweightPolyline (model-space) SA1))
    	(setq OBJ (vla-addLightweightPolyline (paper-space) SA1))
      )
    
    (defun acad-object () 
    (cond (*acad-object*)	   ; Return the cached object 
       (t 
    	(setq *acad-object* (vlax-get-acad-object)) 
       ) 
    ) 
    ) 
     
    (defun active-document () 
    (cond (*active-document*)   ; Return the cached object 
       (t 
    	(setq *active-document* (vla-get-activedocument (acad-object))) 
       ) 
    ) 
    ) 
     
    (defun model-space () 
    (cond (*model-space*)	   ; Return the cached object 
       (t 
    	(setq *model-space* (vla-get-modelspace (active-document))) 
       ) 
    ) 
    ) 
     
    (defun paper-space () 
    (cond (*paper-space*)	   ; Return the cached object 
       (t 
    	(setq *paper-space* (vla-get-paperspace (active-document))) 
       ) 
    ) 
    ) 
    Code:
      (if (= (getvar "CTAB") "Model")
    	(setq OBJ (vla-addLightweightPolyline (model-space) SA1))
    	(setq OBJ (vla-addLightweightPolyline (vla-get-ActiveLayout (active-document)) SA1))
      )
    Thanks

  2. #2
    I could stop if I wanted to pnorman's Avatar
    Join Date
    2005-02
    Location
    Calgary
    Posts
    203
    Login to Give a bone
    0

    Default Re: vla-addLightweightPolyline PaperSpace/Layout

    Forget it. I have found my error.
    It was in the declaration of the variable *paper-space*.
    By making it global it was not being reset after layout changes and as there is only one model space I never had the problem before.

    Cheers
    P

Similar Threads

  1. 2014: Lock views on layout tabs / paperspace
    By themuleman in forum AutoCAD Structural Detailing
    Replies: 0
    Last Post: 2014-02-16, 07:58 PM
  2. Switch to a Specific Paperspace Layout
    By bdwidhalm in forum AutoLISP
    Replies: 2
    Last Post: 2008-12-18, 06:22 PM
  3. Paperspace border X-Ref'd to layout not showing
    By keelay711 in forum AutoCAD Sheet Set Manager
    Replies: 2
    Last Post: 2007-02-13, 12:53 AM
  4. turn off layers in another paperspace layout
    By gisdude in forum AutoCAD Map 3D - General
    Replies: 1
    Last Post: 2007-02-12, 07:41 PM
  5. scale TEXT TO LAYOUT (paperspace)
    By arshadmirza786 in forum AutoCAD Wish List
    Replies: 3
    Last Post: 2004-10-22, 07:13 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
  •