transcad Posted April 26, 2012 Posted April 26, 2012 I have a lisp that draw some things, after i select a point - like a reference point. If i select the point in model, those things will be drawn in model, and if i switch to paper, will be drawn in paper - like the point was selected in paper. I want to use my lisp both ways, if i work in model or in paper, but those things that should be made by lisp to be drawn always in model or paper - how to do it? Quote
MSasu Posted April 26, 2012 Posted April 26, 2012 Use CTAB variable to check or set the current tab: (getvar "CTAB") (setvar "CTAB" "Model") The LAYOUTLIST function will give you the list of layout tabs available in drawing. (layoutlist) Quote
Lt Dan's legs Posted April 26, 2012 Posted April 26, 2012 (defun aspace nil (vlax-get (setq *acdoc* (cond ( *acdoc* ) ( (vla-get-activedocument (vlax-get-acad-object) ) ) ) ) (cond ( (eq AcModelSpace (vlax-get *acdoc* 'ActiveSpace)) 'ModelSpace ) ( 'PaperSpace ) ) ) ) Example: (vlax-invoke (aspace) 'addline '(0. 0. 0.) '(1. 1. 0.)) Quote
MSasu Posted April 27, 2012 Posted April 27, 2012 Taking into consideration the extra information received through PM, my answer is yes, it is possible to take a point on a tab, then switch to other one and use that point as reference for a draw operation. Please see example below: (setvar "CTAB" "Model") (setq point1st (getpoint "\nIndicate insertion point: ")) (setvar "CTAB" (car (layoutlist))) (command "_CIRCLE" "_non" point1st 5.0) But, I'm not sure how to pause the routine evaluation to allow user to indicate the new tab. You may do that by a dialog or by a prompter (GETSTRING with INITGET), although this may not be reliable for a long list of layouts, long and/or based on a patter names for layout or even usage of space(s) on layout names. I hope someone else can suggest you a better solution. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.