Author Topic: Changing current viewport in the middle of a routine.  (Read 11362 times)

0 Members and 1 Guest are viewing this topic.

CADaver

  • Guest
Changing current viewport in the middle of a routine.
« on: November 06, 2003, 09:47:28 AM »
I need a little help here. I've asked this over on "the other board", but I'm gonna repeat it here.  I'm collecting information in one viewport and I'd like to change current viewports prior to executing the function. How do you pause a lisp routine to select a different viewport?

thanks

daron

  • Guest
Changing current viewport in the middle of a routine.
« Reply #1 on: November 06, 2003, 10:35:05 AM »
You have to have the function in the lisp to be able to do it.

ELOQUINTET

  • Guest
Changing current viewport in the middle of a routine.
« Reply #2 on: November 06, 2003, 10:35:50 AM »
hmmm i asked this over at "the other board" awhile back too and the variable is ctab but this just sets what viewport is current. i was trying to use it for the auto number routine so i could easily number my pages but noone could seem to help me. well unfortunately that's all the info i have on the topic. if you find out let me know...

dan

Mark

  • Custom Title
  • Seagull
  • Posts: 28753
Changing current viewport in the middle of a routine.
« Reply #3 on: November 06, 2003, 11:58:52 AM »
Quote
How do you pause a lisp routine to select a different viewport?

Need more info, say the user is on a layout tab called sheet1 and you want the user to select another tab before the program runs. Something like that? Or do you just want to go back to Modelspace?
TheSwamp.org  (serving the CAD community since 2003)

CADaver

  • Guest
Changing current viewport in the middle of a routine.
« Reply #4 on: November 06, 2003, 12:12:30 PM »
Quote from: Mark Thomas
Or do you just want to go back to Modelspace?


I'm starting and staying in TILEMODE=1 for right now.  I find it easier for the first model building pass.

What I have is a lame DVIEW CLIPPING function that clips the current view.  What I want is to collect the dtat in the current view, but execute the CLIP in a different view.

Code: [Select]
Psuedo code:
(in a plan view)
Get TARGET point pt1
Get CAMERA point pt2
Enter slice Depth (getdist)
             (change to different viewport)  <- this is what I need
DVIEW PO PT1 PT2 CL B (one - half DEPTH) CL F (half depth)

Bill::Meat4Brains

  • Guest
Changing current viewport in the middle of a routine.
« Reply #5 on: November 06, 2003, 01:24:26 PM »
did you see this post?
http://theswamp.org/phpBB2/viewtopic.php?p=871#871

when you mean view I take it you mean a split screen different viewport.  I recall a function called follow that would center the current viewport on another viewport.  I don't have it here - hopefully I can find it in archives at home.  but the code in it sounds like a starting point to make what you are looking for.

CADaver

  • Guest
Changing current viewport in the middle of a routine.
« Reply #6 on: November 06, 2003, 03:16:17 PM »
Quote from: Bill::Meat4Brains
did you see this post?
http://theswamp.org/phpBB2/viewtopic.php?p=871#871

when you mean view I take it you mean a split screen different viewport.  I recall a function called follow that would center the current viewport on another viewport.  I don't have it here - hopefully I can find it in archives at home.  but the code in it sounds like a starting point to make what you are looking for.


Cool, thanks.

Maybe I can flesh out what I mean a little better  (hey bear with me, I'm a Texan, English is a foreign language fer me.) :roll:

TILEMODE=1
two viewports split vertically
Left viewport has a plan view of a structure
Right viewport viewpoint doesn't matter
I want to pick two points in the lefthand viewport:
   One for TARGET
   And one for angle of CAMERA from TARGET
Then enter the depth of the slice.
;;;;;;;;;;;I've got everything above this working
Then I want to select the RIGHTHAND viewport to display the slice.  That's where I'm lost.  In lisp, I don't know how to select another viewport to make it current. :shock:

I don't want to depend on preset CVPORT numbers because the next guy may have 4 viewports with the primary being an elevation from which he wants to cut plans.

Clear as mud, right?

CADaver

  • Guest
Changing current viewport in the middle of a routine.
« Reply #7 on: November 06, 2003, 04:32:02 PM »
This thread pobably belongs over in "VLISP HACKERS".  I thought that's where I was when I started it, but then "dead guys" have never been real bright.  Should some kind-hearted, over-worked, under-appreciated, admin-type please see fit to correct my extreme error, I would sing his praises loud and long.

CADaver

  • Guest
Changing current viewport in the middle of a routine.
« Reply #8 on: November 07, 2003, 09:01:39 AM »
Here's what I have so far, but the (getpoint) in the middle for the viewport selection requires TWO picks or a pick+enter.  I'm looking for a single pick.



Code: [Select]
(setq dvsdeep 12.0)
(defun c:DVSECTION (/ pt1 pt2 ang)
(command ".undo" "begin")
(setq curvp (getvar "cvport"))
(command "ucs" "v")
     (setq pt1 (getpoint "\nSelect Centerpoint of Section: "))
     (setq ang (getangle pt1 "\nEnter Viewing Point Angle from Section: "))
     (setq pt2 (polar pt1 ang 12))
(IF (SETQ Ndvsdeep (GETDIST (STRCAT "Enter Depth of Section: <" (RTOS dvsdeep) ">: ")))
(setq dvsdeep ndvsdeep)
)
  (setq pt1 (trans pt1 1 0) pt2 (trans pt2 1 0))
  (command "ucs" "w")

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;



(prompt "\n Select Viewport for Section Display, TWICE ")
(getpoint)



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;
   (command "dview" "" "po" pt1 pt2 "cl" "f" (/ dvsdeep 2.0) "cl" "b" (- 1.0 (/ dvsdeep 2.0)) "")
   (command ".zoom" "e" ".zoom" ".8x")
(setvar "cvport" curvp)
(command ".undo" "end")
)



Be kind, remember I'm your basic lisp slug.

CADaver

  • Guest
Changing current viewport in the middle of a routine.
« Reply #9 on: November 10, 2003, 09:45:45 AM »
Quote from: Bill::Meat4Brains
did you see this post?
http://theswamp.org/phpBB2/viewtopic.php?p=871#871


No, I hadn't seen that before, wish I had cuz' its very darn close to what I'm doing and would have saved me some time.  The difference is that I want the new view to reside in a different viewport.  That way I can have a "plan view" of a structure in one viewport and "throw" the "sliced" views into other viewports without changing the "plan view" viewport.

Right now I'm using a (getpoint) to pause for the selection of a point, but that requires 2 picks or a pick+enter.  I got that idea from the express tools CHSPACE function that uses a (getstring), I was hoping for something slicker.

rude dog

  • Guest
Changing current viewport in the middle of a routine.
« Reply #10 on: November 11, 2003, 07:54:56 AM »
cadaver ...wish I knew more to help...I scanned some info from a book i have and turned the 4 pages into a pdf file how can i get them to you?...maybe you can understand them..im not there yet dude

Mark

  • Custom Title
  • Seagull
  • Posts: 28753
Changing current viewport in the middle of a routine.
« Reply #11 on: November 11, 2003, 08:14:16 AM »
Quote
how can i get them to you?...


Use the pond.....................
You can upload/download from here.
http://theswamp.org/lilly.pond/
TheSwamp.org  (serving the CAD community since 2003)

rude dog

  • Guest
Changing current viewport in the middle of a routine.
« Reply #12 on: November 11, 2003, 10:03:10 AM »
10-4 its there "vplispdoc.pdf"http://theswamp.org/lilly.pond/
hope it helps...only hand i can offer :x

CADaver

  • Guest
Changing current viewport in the middle of a routine.
« Reply #13 on: November 11, 2003, 11:39:37 AM »
Thanks Dog,
   I'll take all the help I can get.  I'm gonna print it to look at later.  

   For some reason the boss wants me to actually do some work today.  The nerve of some people, expecting me to work, sheesh.

hendie

  • Guest
Changing current viewport in the middle of a routine.
« Reply #14 on: November 12, 2003, 07:24:31 AM »
I've been playing around with it albeit unsuccessfully.
the best I've managed to come up with is switching to the next viewport for the clipping, but the next viewport may not be the one suitable for other users.
another option may be to split the current viewport into two and clipping one of those viewports, would that be an option ?


what happens after you display the slice ?

I think we may need some lateral thinking here.