home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-10-08 | 78.8 KB | 2,335 lines |
- ;;; MVSetup.lsp
- ;;; Copyright (C) 1990 by Autodesk, Inc.
- ;;;
- ;;; THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
- ;;; ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF
- ;;; MERCHANTABILITY ARE HEREBY DISCLAIMED.
- ;;;
- ;;; by Jan S. Yoder
- ;;;
- ;;;----------------------------------------------------------------------------
- ;;; DESCRIPTION
- ;;;
- ;;; This is a new setup routine for Release 11 and Mview.
- ;;;
- ;;; It is based around a set of functionality that was determined to be a
- ;;; necessary part of preparing a drawing for plotting. This routine allows
- ;;; the user to insert several pre-defined title blocks (ANSI A - E) and in
- ;;; addition it allows the user to create a set of viewports within the
- ;;; title block just inserted. A global scale may be specified as a ratio
- ;;; between the scale of the title block in paperspace and the model geometry
- ;;; in modelspace. For example, if you were doing an engineering drawing at
- ;;; a scale of 1:4 or quarter scale, then you would specify that you wanted
- ;;; a ratio of 1 paperspace unit to 4 modelspace units. The routine will
- ;;; convert this to 0.25xp for the Zoom command. You may also elect to
- ;;; align the viewports.
- ;;;
- ;;; (The first time you invoke MVSETUP, you may notice a slight delay.
- ;;; This occurs because the routine is creating a default file of various
- ;;; title blocks and viewport layouts. If you should accidentally erase
- ;;; your default file, another will be created the next time you invoke
- ;;; MVSETUP. The file will be created in the directory specified by the
- ;;; AutoCAD system variable "ACADPREFIX". If you run AutoCAD from a
- ;;; directory other than that one, and the system variables ACAD or ACADCFG
- ;;; do not point to that directory, then MVSETUP will not be able to find
- ;;; it, and will create a new one in the directory pointed to by the first
- ;;; path found in the current setting of the AutoCAD system variable
- ;;; "ACADPREFIX".)
- ;;;
- ;;; When you invoke MVSETUP from the command line or one of the menus, you
- ;;; are given four options; three dealing with the creation and manipulation
- ;;; of viewports, and one which allows you to insert various "title blocks".
- ;;; The initial prompts are shown below.
- ;;;
- ;;;
- ;;; MVSetup, Version 1.0, (c) 1990 by Autodesk, Inc.
- ;;; Align viewports/Create viewports/Scale viewports/Title block/Undo:
- ;;;
- ;;; The Align viewports option presents you with several more options; you
- ;;; are asked to determine the type of alignment you wish to perform.
- ;;;
- ;;; Angled/Horizontal/Vertical alignment/Rotate view/Undo?
- ;;;
- ;;; The Horizontal and Vertical options ask you to pick a basepoint in one
- ;;; viewport, and the point to move in another viewport. The view in the
- ;;; second viewport is panned by the offset distance in X or Y between
- ;;; the two points relative to the zoom scale factor of the second viewport.
- ;;;
- ;;; The Angled option asks you for these two points and for a distance and
- ;;; angle from the basepoint. The point in the first viewport at the
- ;;; specified distance and angle from the basepoint is where the "other"
- ;;; point will be panned.
- ;;;
- ;;; The Rotate view option asks you for a basepoint and a rotation angle
- ;;; and uses the DVIEW command to change the view twist. This generally
- ;;; will be useful only when the UCS of the view you are rotating is
- ;;; parallel to the screen and would be used to align a view with an
- ;;; angled edge with the Align Angled option.
- ;;;
- ;;; Selecting Create viewports prompts you with the following:
- ;;;
- ;;; Delete objects/<Create viewports>:
- ;;;
- ;;; Selecting Delete objects provides you with a general selection prompt
- ;;; at which time you may delete any paperspace objects that you wish.
- ;;; This is intended to allow you to clear an area for your new viewports.
- ;;; Modelspace entities will NOT be removed.
- ;;;
- ;;;
- ;;; Selecting Create viewports prompts you to select one of the viewport
- ;;; options listed.
- ;;;
- ;;; Available Mview viewport layout options:
- ;;;
- ;;; 0: None
- ;;; 1: Single
- ;;; 2: Std. Engineering
- ;;; 3: Array of Viewports
- ;;;
- ;;; Redisplay/<Number of entry to load>:
- ;;;
- ;;; Pressing RETURN or selecting "None" returns you to the main prompt
- ;;; without creating any viewports.
- ;;;
- ;;; "Single" is a single viewport which can fill the default area open in
- ;;; the sheet or it can be located by picking two points on the screen.
- ;;;
- ;;; Std. Engineering is a set of four viewports with the upper left viewport
- ;;; in plan view, the lower left in a front view, the lower right in a right
- ;;; side view, and the upper right in an oblique view at -45 degrees from 0
- ;;; and up 30 degrees.
- ;;;
- ;;; The "Array of Viewports" allows you to specify any array of viewports
- ;;; that you want to place on your sheet, from a 1 by 2 or 2 by 1 to any
- ;;; level allowed by AutoCAD.
- ;;;
- ;;;
- ;;; After selecting option 1, 2 or 3, you are prompted to specify the bounding
- ;;; area for the viewports that are to be created. Each of the title blocks
- ;;; provided has a bounding region defined for it in the default file. You
- ;;; can elect to create all of the viewports within this region by selecting
- ;;; "Default" at the following prompt:
- ;;;
- ;;; Bounding area for viewports. Default/<First point >:
- ;;;
- ;;; You can also select two points on the screen and the number of viewports
- ;;; you subsequently define will be mapped into this area.
- ;;;
- ;;; Picking options 2 or 3 prompts you to specify the distance between the
- ;;; viewports; the interstitial distance. This value must be a positive
- ;;; number but may be zero. The value you enter for X is automatically
- ;;; assigned to Y, though you may specify Y to have a different value.
- ;;; If you selected option 2 above, then the four viewports are created and
- ;;; the four views are mapped into them as defined in the default file.
- ;;; The other options create the viewports but do not change the views in
- ;;; any of them; the view will be a plan view in the current UCS.
- ;;;
- ;;;
- ;;; Selecting Scale viewports at the main menu prompts you to select the
- ;;; viewports you wish to scale. If you select one or more viewports
- ;;; you asked whether you wnat to set the zoom scales all at once or for
- ;;; each viewport separately:
- ;;;
- ;;; Set zoom scale factors for viewports. Interactively/<Uniform>:
- ;;;
- ;;; After selecting one of these you are asked the following;
- ;;;
- ;;; Enter the ratio of paper space units to model space units...
- ;;; Number of paper space units. <1.0>:
- ;;; Number of model space units. <1.0>:
- ;;;
- ;;; The number of viewports specified will have their zoom scales changed
- ;;; by the ratio of the paper space units divided by the model space units.
- ;;; This is cumulative over time, so performing this operation twice with
- ;;; paper space units set to 1.0 and model space units set to 2.0 will give
- ;;; the same results as doing it once with 1.0 an 4.0 as the values.
- ;;;
- ;;;
- ;;; Selecting Title block from the main menu gives you another sub-menu.
- ;;;
- ;;; Delete objects/Origin/<Insert title block>:
- ;;;
- ;;; Delete objects works as described above under Create viewports.
- ;;; Origin allows you to specify a new UCS origin for the subsequent
- ;;; insertion of a title block. Pressing RETURN will cause you to be
- ;;; presented with a list of available title blocks or sheets.
- ;;;
- ;;; Available title block options:
- ;;;
- ;;; 0: NONE
- ;;; 1: ANSI-V Size
- ;;; 2: ANSI-A Size
- ;;; 3: ANSI-B Size
- ;;; 4: ANSI-C Size
- ;;; 5: ANSI-D Size
- ;;; 6: ANSI-E Size
- ;;; 7: Arch/Engineering (24 x 36)
- ;;;
- ;;; Add/Redisplay/<Number of entry to load>:
- ;;;
- ;;; This list includes the ANSI standard sheet layouts from A to E and
- ;;; includes size A Vertical. Selecting the number preceding one of the
- ;;; selections causes one of two things to occur. One, if the AutoCAD
- ;;; drawing associated with the selections cannot be found, then the
- ;;; default file is read, a definition is extracted, and the drawing is
- ;;; created in your current drawing. You are then asked whether you want
- ;;; to save this drawing to disk. If you want to use this drawing more
- ;;; than once, you should answer Yes to this prompt. Two, if the AutoCAD
- ;;; drawing can be found then it is INSERTed into your drawing at 0,0.
- ;;;
- ;;; The other options are Add, Delete and Redisplay.
- ;;;
- ;;; Pressing RETURN or selecting 0 for "None" at this prompt returns you
- ;;; to the main menu. Selecting the number of a viable entry causes one
- ;;; of two things to occur: if you selected one of the built-in entries,
- ;;; and you have not created a drawing by the name associated with this
- ;;; entry, the default file is scanned for a definition, and if found,
- ;;; the title block is created in your current drawing. You are asked
- ;;; whether you want to create a drawing of the entities just created.
- ;;; For example, picking 1 (ANSI-V Size) gives you the following prompt:
- ;;;
- ;;; Create a drawing named ansi-v.dwg? <Y>:
- ;;;
- ;;; Answering Yes causes a drawing to be created and reinserted into your
- ;;; drawing where it was created.
- ;;;
- ;;; If the drawing already exists it is inserted at the current UCS origin.
- ;;; This is the mechanism for using your own title blocks and parts of
- ;;; title blocks.
- ;;;
- ;;; Selecting Add after the available title blocks are listed gives you
- ;;; the following prompts; example text is given in parentheses:
- ;;;
- ;;; Name to save: (Title block 1)
- ;;;
- ;;; Block to insert: (tb-1)
- ;;;
- ;;; A line looking like this
- ;;;
- ;;; Title block 1,tb-1.dwg
- ;;;
- ;;; is added after the last entry in the default file.
- ;;;
- ;;; Selecting Delete at the same prompt allows you to delete any of the
- ;;; lines listed except line 0. Redisplay causes the list to be displayed
- ;;; again.
- ;;;
- ;;; If neither a valid drawing or a definition can be found you are so
- ;;; informed and returned to the main menu.
- ;;;
- ;;;
- ;;;
- ;;;
- ;;;
- ;;;
- ;;;----------------------------------------------------------------------------;
- ;;;
- ;;; Multiple Viewport SETUP routine for Release 11
- ;;; Start routine from a screen menu pick or from a pulldown menu item.
- ;;;
- (defun mv_sup ( / mv_err s mv_oer mv_oce mv_olu ll_crn need_z)
-
- ;;
- ;; Internal error handler defined locally
- ;;
-
- (defun mv_err (s) ; If an error (such as CTRL-C) occurs
- ; while this command is active...
- (if (/= s "Function cancelled")
- (if (= s "quit / exit abort")
- (princ)
- (princ (strcat "\nError: " s))
- )
- )
- (if deffi (close deffi))
- (if deffo (close deffo))
- (command "undo" "end")
- (if mv_oer ; If an old error routine exists
- (setq *error* mv_oer) ; then, reset it
- )
- (setvar "cmdecho" mv_oce) ; Reset command echoing on error
- (if mv_olu (setvar "lunits" mv_olu)) ; Restore prev. linear units value
- (princ)
- )
-
- (if *error* ; If there is an error routine defined
- (setq mv_oer *error* ; Store AutoLisp error routine
- *error* mv_err) ; Temporarily replace it
- )
-
- (setq mv_oce (getvar "cmdecho"))
- (setvar "cmdecho" 0) ; Turn off command echoing
- (if (mv_ctm) ; Is Tile-mode on? T or nil
- (mv_dos) ; Do old setup
- ;; else
- (mv_dns) ; Do new setup
- )
- (if deffi (setq deffi (close deffi)))
- (if deffo (setq deffo (close deffo)))
- (setvar "cmdecho" mv_oce) ; Reset command echoing
- (if mv_oer ; If an old error routine exists
- (setq *error* mv_oer) ; then, reset it
- )
- (princ)
- )
- ;;;
- ;;; Check Tile-mode. Returns T if ON and nil if not on.
- ;;;
- ;;; mv_ctm == MView_Check_TileMode
- ;;;
- (defun mv_ctm ()
- (if (= (getvar "TILEMODE") 1)
- (progn
- (initget "Yes No")
- (setq ans (getkword (strcat
- "\nPaperspace/Modelspace is disabled. The old setup will be "
- "\ninvoked unless it is enabled. Enable Paper/Modelspace? <Y>: "))
- )
- (if (= ans "No")
- T
- (progn
- (setvar "TILEMODE" 0)
- nil
- )
- )
- )
- nil
- )
- )
- ;;;
- ;;; Do a new setup relative to a point to be given by the user.
- ;;; The default is the current 0,0,0.
- ;;;
- ;;; mv_dns == MView_Do_New_Setup
- ;;;
- (defun mv_dns (/ mv_ver mv_xdf mv_xlf o_cvpt ans sset ITEM_LIST fd)
-
- (setq mv_ver "1.00b") ; Reset this local if you make a change.
- (setq mv_xpf (mv_cpf (getvar "acadprefix" )))
-
- (setq mv_xdf (strcat mv_xpf "mvsetup.dfs"))
- (setq mv_xlf "mvsetup.lsp") ; Reset these locals if you make changes.
-
- (setq uctr 0)
- (setq o_cvpt (getvar "cvport"))
- (if (/= o_cvpt 1)
- (command "pspace") ; Change to paperspace
- )
-
- ;; Look for external definitions -- set fd to file descriptor
- (setq fd (mv_lfx mv_xdf "r"))
-
- ;; Close the file, but do not set the handle to nil.
- (if fd (close fd))
-
- (if (null fd)
- ;; then
- (progn
- (princ (strcat "\n\tCreating the default file mvsetup.dfs"
- "\n\tin the directory "
- mv_xpf ". "))
- (mv_cdf)
- (setq fd (mv_lfx mv_xdf "r"))
-
- ;; Close the file; we were just checking to see if it was there.
- (close fd)
- )
- ;; else
- )
- (princ (strcat
- "\n\tMVSetup, Version " mv_ver ", (c) 1990 by Autodesk, Inc. "))
- (setq temp T)
- (while temp
- (initget "Align Create Scale Title Undo")
- (setq ans (getkword (strcat
- "\n\tAlign viewports/Create viewports/"
- "Scale viewports/Title block/Undo: ")))
-
- (cond
- ((= ans "Align")
- (mv_vpa) ; Viewport alignment
- )
- ((= ans "Create")
- (setq temp1 T)
- (while temp1
- (initget "Create Delete Undo")
- (setq ans (getkword
- "\n\tDelete objects/Undo/<Create viewports>: "))
- (cond
- ((= ans "Delete")
- (command "undo" "group")
- (setq uctr (1+ uctr))
-
- (princ "\n\tSelect the objects to delete: ")
- (setq sset (ssget))
- (if sset
- (command "erase" sset "")
- )
- (command "undo" "en")
- )
- ((= ans "Undo")
- (cond
- ((= uctr 0) (princ "\n\tNothing to undo. \n"))
- ((> uctr 0)
- (command "u")
- (setq uctr (- uctr 1)
- ll_crn nil
- )
- )
- )
- )
- (T
- (command "undo" "group")
- (setq uctr (1+ uctr))
- (setq temp1 nil)
- (if (setq deffi (mv_lfx mv_xdf "r"))
- (progn
- (textpage)
- (setq str1 "\n\tAvailable Mview viewport layout options: \n")
-
- (setq vp_item_list (mv_pao "MVIEWS" str1))
-
- (if (and (= (type vp_item_list) 'LIST) (null skip))
- (mv_mvi)
- )
- (setq deffi (close deffi))
- )
- (princ (strcat "
- \n\tCouldn't open the file " mv_xdf " for reading. "))
- )
- (command "undo" "en")
- )
- )
- )
- (command "undo" "en")
- )
- ((= ans "Scale")
- (mv_szs) ; Set zoom scale factors
- )
- ((= ans "Title")
- (setq temp1 T)
- (while temp1
- (if (/= (getvar "cvport") 1)
- (command "pspace")
- )
- (initget "Delete Origin Insert Undo")
- (setq ans (getkword
- "\n\tDelete objects/Origin/Undo/<Insert title block>: "))
- (cond
- ((= ans "Delete")
- (command "undo" "group")
- (setq uctr (1+ uctr))
-
- (princ "\n\tSelect the objects to delete: ")
- (setq sset (ssget))
- (if sset
- (command "erase" sset "")
- )
- (command "undo" "en")
- )
- ((= ans "Origin")
- (command "undo" "group")
- (setq uctr (1+ uctr))
-
- ;; Get an origin point for the new title block.
- (initget 1)
- (setq ans (getpoint '(0 0 0)
- "\n\tNew origin point for this sheet: "))
- (command "ucs" "o" ans)
- (command "undo" "en")
- )
- ((= ans "Undo")
- (cond
- ((= uctr 0) (princ "\n\tNothing to undo. \n"))
- ((> uctr 0)
- (command "u")
- (setq uctr (- uctr 1)
- ll_crn nil
- )
- )
- )
- )
- (T
- (command "undo" "group")
- (setq uctr (1+ uctr))
- (setq temp1 nil)
- (if fd
- (mv_gop)
- (princ (strcat
- "\nCouldn't open the file " mv_xdf " for reading. "))
- )
- (command "undo" "en")
- )
- )
- )
- (command "undo" "en")
- )
- ((= ans "Undo")
- (cond
- ((= uctr 0) (princ "\n\tNothing to undo. \n"))
- ((> uctr 0)
- (command "u")
- (setq uctr (- uctr 1)
- ll_crn nil
- )
- )
- )
- )
- (T
- (setq temp nil)
- )
- )
- )
- (if (/= o_cvpt 1)
- (progn
- (setq sset (ssget "x" '((0 . "VIEWPORT"))))
- (if sset
- (setq o_cvpt (mv_vvp o_cvpt sset))
- (setq o_cvpt nil)
- )
- (command "mspace") ; Change to modelspace
- ;; If the previously current viewport has been deleted,
- ;; this will do nothing.
- (if o_cvpt (setvar "cvport" o_cvpt)) ; Restore previous active viewport
- )
- )
- )
- ;;;
- ;;; Return the first path in ACADPREFIX delimited by ";".
- ;;;
- ;;; mv_cpf == MView_Check_acadPreFix
- ;;;
- (defun mv_cpf (pf / temp)
- (setq j 1
- l (strlen pf)
- )
- (while (<= j l)
- (if (= (substr pf j 1) ";")
- (progn
- (setq temp (substr pf 1 (1- j)))
- (setq j (1+ l))
- )
- (setq j (1+ j))
- )
- )
- (if temp
- temp
- pf
- )
- )
- ;;;
- ;;; Verify the Mview viewport whose number we have in vp_n.
- ;;;
- ;;; mv_vvp == MView_Verify_ViewPort
- ;;;
- (defun mv_vvp (num sset / j vp ss_len cont)
- (setq ss_len (sslength sset)
- j 0
- cont T
- )
- (while (and cont (< j ss_len))
- (setq temp (entget (ssname sset j)))
- (setq j (1+ j))
- (if (= (cdr(assoc 68 temp)) 2)
- (setq vp temp)
- )
- (if (= (cdr(assoc 69 temp)) num)
- (setq cont nil
- vp temp
- )
- )
- )
- (cdr(assoc 69 vp))
- )
- ;;;
- ;;; Align viewport geometry
- ;;;
- ;;; mv_vpa == MView_ViewPort_Align
- ;;;
- (defun mv_vpa ( / temp temp1 ans p1 pt1 p2 a1 d1)
- (setq temp T)
- (while temp
- (initget "Angled Horizontal Rotate Vertical Undo")
- (setq ans (getkword
- "\n\tAngled/Horizontal/Vertical alignment/Rotate view/Undo? "))
- (if (or (= ans "") (= ans "Rotate") (= ans "Undo") (null ans))
- (if (= ans "Rotate")
- (progn
- (princ "\n\tSpecify in which viewport the view is to be rotated. ")
- (command "mspace")
- (command "ucs" "w")
- (setq p1 (getpoint "\n\tBasepoint: "))
- (setq temp (getvar "cvport"))
- (command "ucs" "v")
- (setq a1 (getangle (trans p1 0 1) "\n\tAngle from basepoint: "))
- (command "dview" "" "tw" (* a1 (/ 180 pi)) "")
- (command "ucs" "p")
- (command "ucs" "p")
- (command "pspace")
- )
- (if (= ans "Undo")
- (cond
- ((= uctr 0) (princ "\n\tNothing to undo. \n") )
- ((> uctr 0)
- (command "u")
- (setq uctr (- uctr 1)
- ll_crn nil
- )
- )
- )
- (setq temp nil)
- )
- )
- (progn
- (command "undo" "group")
- (setq uctr (1+ uctr))
- (command "mspace")
- (command "ucs" "w")
- (setq p1 (getpoint "\n\tBasepoint: "))
- (setq pt1 (trans (trans p1 1 2) 2 3))
- (setq temp (getvar "cvport"))
-
- (setq p2 (getpoint "\n\tOther point: "))
- (setq p2 (trans (trans p2 1 2) 2 3))
- (cond
- ((= ans "Angled")
- (setq temp1 (getvar "cvport"))
- (if (= temp1 temp)
- (princ "\n\tPoints must be in different viewports. ")
- (progn
- (setvar "cvport" temp)
- (setvar "orthomode" 0)
- (princ (strcat
- "\n\tSpecify the distance and angle "
- "to the new alignment point "))
- (princ (strcat
- "\n\tin the current viewport where "
- "you specified the basepoint. "))
- (setq d1 (getdist "\n\tDistance from basepoint: "))
- (setq a1 (getangle "\n\tAngle from basepoint: "))
- (setq p1 (polar p1 a1 d1))
- (setq p1 (trans (trans p1 1 2) 2 3))
- (setvar "cvport" temp1)
- (command "ucs" "v")
- (command "pan" (trans p2 3 2) (trans p1 3 2))
- )
- )
- )
- ((= ans "Horizontal")
- (setq temp1 (getvar "cvport"))
- (command "ucs" "v")
- (setq p1 (list (car p2) (cadr pt1) (caddr p2)))
- (if (= temp1 temp)
- (princ "\n\tPoints must be in different viewports. ")
- (command "pan" (trans p2 3 2) (trans p1 3 2))
- )
- )
- ((= ans "Vertical")
- (setq temp1 (getvar "cvport"))
- (command "ucs" "v")
- (setq p1 (list (car pt1) (cadr p2) (caddr p2)))
- (if (= temp1 temp)
- (princ "\n\tPoints must be in different viewports. ")
- (command "pan" (trans p2 3 2) (trans p1 3 2))
- )
- )
- (T
- (setq temp nil)
- )
- )
- (command "ucs" "p")
- (command "undo" "en")
- )
- )
- )
- )
- ;;;
- ;;; Read lines from a file until the argument matches the given sub-string
- ;;;
- ;;; mv_rux == MView_Read_Until_Xx_found
- ;;;
- (defun mv_rux (str j k / l cont line)
- (setq cont T l 1)
- (while cont
- (setq line (read-line deffi))
- (setq l (1+ l))
- ;; Seek to the first instance of str at position j - k.
- (if line
- (if (= (substr line j k) str)
- (setq cont nil)
- )
- (progn
- (setq cont nil l nil)
- )
- )
- )
- l ; Return nil or line number where
- ; matching string is found
- )
- ;;;
- ;;; Tokenize the line, removing any blanks not within the string.
- ;;; Return the tokenized list of strings found.
- ;;;
- ;;; mv_tok == MView_TOKenize
- ;;;
- (defun mv_tok (str / sl j str_list)
- (setq s_list (mv_tkw str))
- (setq list_l (length s_list)
- j 0
- )
- (while (< j list_l)
- (setq s_list (subst (mv_tki (nth j s_list)) (nth j s_list) s_list))
- (setq j (1+ j))
- )
- s_list
- )
- ;;;
- ;;; Tokenize the item, removing any leading and trailing blanks.
- ;;; Return the string.
- ;;;
- ;;; mv_tki == MView_ToKenize_Item
- ;;;
- (defun mv_tki (str / sl j k str_list)
- (setq sl (strlen str)
- j 1
- k 0
- )
- (while (and (< j sl) (= (substr str j 1) " "))
- (setq j (1+ j))
- )
- (while (and (< k sl) (= (substr str (- sl k) 1) " "))
- (setq k (1+ k))
- )
- (substr str j (- sl k))
- )
- ;;;
- ;;; Tokenize a string into a list of strings.
- ;;; Return the tokenized string list.
- ;;;
- ;;; mv_tkw == MView_ToKenize_into_Words
- ;;;
- (defun mv_tkw (str / sl k)
- (setq sl (strlen str)
- k 0
- )
- (while (and (< k sl) (/= (substr str (1+ k) 1) ","))
- (setq k (1+ k))
- )
- (if str_list
- (setq str_list (append str_list (list (substr str 1 k))))
- (setq str_list (list (substr str 1 k)))
- )
- (setq k (+ k 2))
- (if (< k sl)
- (mv_tkw (substr str k))
- )
- str_list
- )
- ;;;
- ;;; List names on the screen until an end of list marker is found.
- ;;; Store the items found into a list, ITEM_LIST, a global
- ;;; Ignore blank lines and commented lines. Return number of lines.
- ;;;
- ;;; mv_lns == MView_List_Names_on_Screen
- ;;;
- (defun mv_lns (str j k / l cont line)
- (setq cont T l -1)
- (while cont
- (if (setq line (read-line deffi))
- ;; Seek to the end of the section delimited by "str"
- ;; Else print the line to the screen preceded by an integer
- (if (= (substr line j k) str)
- (setq cont nil)
- (progn
- (setq l (1+ l)
- item (car (mv_tok line))
- ITEM_LIST (if item_list
- (append ITEM_LIST (list (mv_tok line)))
- (list (mv_tok line))
- )
- )
- (if (and (= (rem l 10) 1) (> l 1))
- (if (= (rem l 20) 1)
- (progn
- (princ "\n\t<more> ")
- (grread)
- )
- (terpri)
- )
- )
- (princ (strcat "\n\t" (itoa l) ":\t " item))
- )
- )
- (setq cont nil)
- )
- )
- l
- )
- ;;;
- ;;; Add an entry to the default file. Get all inputs.
- ;;;
- ;;; mv_aef == MView_Add_an_Entry_to_default_File
- ;;;
- (defun mv_aef ( / str ans deffo)
- (setq ans (getstring T "\n\tTitle block description: "))
- (if (not (or (= ans "") (null ans)))
- (progn
- (setq str ans)
- (setq ans (getstring "\n\tDrawing to insert: "))
- (if (not (or (= ans "") (null ans)))
- (progn
- (setq str (strcat str "," ans ".dwg"))
- (close deffi)
- (if (setq deffi (mv_lfx mv_xdf "r"))
- (if (setq deffo (mv_lfx "temp.tdf" "w"))
- (progn
- (setq cur_ln (+ cur_ln max_l))
- (repeat cur_ln (progn
- (write-line (read-line deffi) deffo)
- ))
- (write-line str deffo)
- (while (setq line (read-line deffi))
- (write-line line deffo)
- )
- )
- )
- )
- (setq deffo (close deffo))
- (setq deffi (close deffi))
- (if (setq deffi (mv_lfx "temp.tdf" "r"))
- (if (setq deffo (mv_lfx mv_xdf "w"))
- (while (setq line (read-line deffi))
- (write-line line deffo)
- )
- )
- )
- (setq deffo (close deffo))
- (setq deffi (close deffi))
- (command "files" "3" "temp.tdf" "" "")
- (textpage)
- )
- )
- )
- )
- )
- ;;;
- ;;; Subtract an entry from the default file. Get all inputs.
- ;;;
- ;;; mv_sef == MView_Subtract_an_Entry_from_default_File
- ;;;
- (defun mv_sef ( / str ans deffo)
- (setq str (nth 0 d_item_list))
- (setq deffi (close deffi))
- (if (setq deffi (mv_lfx mv_xdf "r"))
- (if (setq deffo (mv_lfx "temp.tdf" "w"))
- (progn
- (setq cur_ln (mv_rux str 1 (strlen str)))
- (setq cur_ln (- cur_ln 2))
- (close deffi)
- (setq deffi (mv_lfx mv_xdf "r"))
-
- (repeat cur_ln (progn
- (write-line (read-line deffi) deffo)
- ))
- (read-line deffi)
- (while (setq line (read-line deffi))
- (write-line line deffo)
- )
- )
- )
- )
- (setq deffo (close deffo))
- (setq deffi (close deffi))
- (if (setq deffi (mv_lfx "temp.tdf" "r"))
- (if (setq deffo (mv_lfx mv_xdf "w"))
- (while (setq line (read-line deffi))
- (write-line line deffo)
- )
- )
- )
- (setq deffo (close deffo))
- (setq deffi (close deffi))
- (command "files" "3" "temp.tdf" "" "")
- (textpage)
- (setq deffi (mv_lfx mv_xdf "r"))
-
- (princ)
- )
- ;;;
- ;;; Pick from the list by typing an integer, returns the item or zero.
- ;;; cont is global to this routine, local to the calling routine.
- ;;;
- ;;; mv_pfl == MView_Pick_From_List
- ;;;
- (defun mv_pfl (max_l ig_b ig_str prmpt / OK ans return str)
- (while (null OK)
- (initget ig_b ig_str)
- (setq ans (getint prmpt))
- (cond
- ((or (= ans "") (null ans))
- (setq OK T cont nil return 0)
- )
- ((= ans "Add")
- (mv_aef)
- (setq OK T)
- )
- ((= ans "Delete")
- (setq str "\n\tNumber of entry to delete from list: ")
- (setq d_item_list (mv_pfl max_l 6 "" str))
- (if (and d_item_list (> d_item_list 0))
- (progn
- (princ (strcat "\n\tDeleting " (car d_item_list) " from list. "))
- (mv_sef)
- )
- )
- (setq OK T cont T return 0)
- )
- ((= ans "Redisplay")
- (setq OK T)
- )
- (T
- (if (and (>= ans 0) (<= ans max_l))
- (setq return (nth ans ITEM_LIST)
- OK T
- cont nil
- )
- (progn
- (princ (strcat
- "\n\tNumber must be between 0 and " (itoa max_l) "\n"))
- (setq OK nil)
- )
- )
- )
- )
- )
- return
- )
- ;;;
- ;;; Get the user's options
- ;;;
- ;;; mv_gop == MView_Get_OPtions
- ;;;
- (defun mv_gop (/ deffi d_item_name max_lines ans cont)
- (if (setq deffi (mv_lfx mv_xdf "r"))
- (progn
-
- (textpage)
- (setq str1 "\n\tAvailable title block options: \n")
-
- (setq d_item_list (mv_pao "NAMES" str1))
-
- (if (and (= (type d_item_list) 'LIST) (null skip))
- (progn
- (mv_tbi)
- (if (> (length d_item_list) 2)
- (progn
- (setq ll_crn (nth 2 d_item_list))
- (if (> (length d_item_list) 3)
- (setq ur_crn (nth 3 d_item_list))
- (setq ll_crn nil ur_crn nil)
- )
- )
- )
- )
- )
- (setq ITEM_LIST nil)
-
- (setq deffi (close deffi))
-
- )
- (princ (strcat "\n\tCouldn't open the file " mv_xdf " for reading. "))
- )
- )
- ;;;
- ;;; Pick options
- ;;;
- ;;; mv_pao == MView_Pick_An_Option
- ;;;
- (defun mv_pao (str str1 / cont max_lines d_item_list)
- (setq cont T)
- (while cont
- (princ str1)
- (setq cur_ln (mv_rux str 1 (strlen str)))
- (setq ITEM_LIST nil)
- (setq max_lines (mv_lns (strcat "END_" str)
- 1 (+ 4 (strlen str))))
- (setq d_item_list (mv_pfl max_lines 4 "Add Redisplay Delete"
- "\n\n\tAdd/Delete/Redisplay/<Number of entry to load>: "))
- ;;
- ;; Skip the title block insertion if "None" is selected.
- ;;
- (if (and (= (type d_item_list) 'LIST) (= (car d_item_list) "None"))
- (setq skip T)
- (setq skip nil)
- )
- ;;
- ;; If the Redisplay option is chosen, rewind the file by
- ;; Closing it, opening it again, and seeking to the start
- ;; of the NAMES section again.
- ;;
- (if cont
- (progn
- (if deffi (setq deffi (close deffi)))
- (if (null (setq deffi (mv_lfx mv_xdf "r")))
- (progn
- (princ (strcat "\n\tCouldn't open " mv_xdf " for reading."))
- (setq cont nil)
- )
- )
- )
- )
- )
- d_item_list
- )
- ;;;
- ;;; Title block insertion
- ;;; Check that the drawing exists and if not, look for
- ;;; reject the selection. If there is a definition, then
- ;;; execute it and perform the WBLOCK command, then
- ;;; insert the resulting block.
- ;;;
- ;;; mv_tbi == MView_Title_Block_Insertion
- ;;;
- (defun mv_tbi ()
- ;;
- ;; a definition in the default file. If that fails, then
-
- (if (> (length d_item_list) 1)
- (if (setq block_name (findfile (nth 1 d_item_list)))
- (progn
- (command "insert" block_name "0,0" "" "" "")
- (command "zoom" "e")
- )
- ;; Block named not found; try to create it...
- (progn
- (setq block_name (nth 1 d_item_list))
- (setq e_last (cdr(assoc -1 (entget(entlast)))))
- (setq item_name (strcat "NAME - " (nth 0 d_item_list)))
- (if (mv_rux item_name 1 (strlen item_name))
- (mv_cfd)
- )
- (if (not (eq (cdr(assoc -1 (entget(entlast)))) e_last))
- (progn
- (setq sset (ssadd)) ; Create a null selection set.
- (while (setq e_last (if e_last (entnext e_last) (entnext)))
- (ssadd e_last sset) ; Add new entities to end of database.
- )
- (initget "Yes No")
- (setq ans (getkword (strcat
- "\n\tCreate a drawing named " block_name "? <Y>: ")))
- (if (= ans "No")
- ;; Then do nothing...
- (princ)
- ;; Else...
- (progn
- (command "wblock" block_name "" "0,0" sset "")
- (command "insert" block_name "0,0" "" "" "")
- )
- )
- )
- (progn
- (princ (strcat
- "\n\tCouldn't find a definition for block " block_name ". "))
- ;;(exit)
- )
- )
- )
- )
- (progn
- (setq d_item_list (strcat "NAME - " (nth 0 d_item_list)))
- (if (mv_rux d_item_list 1 (strlen d_item_list))
- (mv_cfd)
- )
- )
- )
- )
- ;;;
- ;;; Create the mview viewports.
- ;;;
- ;;; mv_mvi == MView_MView_Insertion
- ;;;
- (defun mv_mvi (/ n_vp_x n_vp_y i_l_len p1 p2)
- (if (> (length vp_item_list) 0)
- (progn
- (if (> (length vp_item_list) 2)
- (setq n_vp_x (nth 1 vp_item_list)
- n_vp_y (nth 2 vp_item_list)
- )
- )
- (if (> (setq i_l_len (length vp_item_list)) 3)
- (setq view_n (- i_l_len 3)) ; Number of views defined.
- )
- (setq d_item_name (strcat "VPSETNAME - " (nth 0 vp_item_list)))
- (if (mv_rux d_item_name 1 (strlen d_item_name))
- (progn
- (mv_gba) ; Get bounding area
- (mv_gnv) ; Get number of viewport
- (mv_gid) ; Get interstitial distances
- (mv_cfp) ; Calculate first points
- (mv_cba) ; Check area is on-screen
- (setvar "osmode" 0)
- (command "mview" p1 p2)
- (setq f_vp_n (mv_gvn)) ; Get viewport number
- (mv_avp) ; Array other Mview viewports
- (setq l_vp_n (mv_gvn)) ; Get viewport number
- (mv_cav) ; Change the view of all viewports
- )
- )
- )
- )
- )
- ;;;
- ;;; Set the zoom scale factors for a set of viewports.
- ;;;
- ;;; mv_szs == MView_Set_Zoom_Scales
- ;;;
- (defun mv_szs ( / temp)
- (command "undo" "group")
- (setq uctr (1+ uctr))
- (if (/= (getvar "cvport") 1)
- (command "pspace")
- )
- (princ "\n\tSelect the viewports to scale: ")
- (setq sset (ssget))
- (if sset
- (progn
- (if (> (sslength sset) 1)
- (progn
- (initget "Interactively Uniform")
- (setq ans (getkword (strcat
- "\n\tSet zoom scale factors for viewports. "
- "Interactively/<Uniform>: "))
- )
- (if (= ans "Interactively")
- (setq vp_s_i T)
- (setq vp_s_i nil)
- )
- )
- (setq vp_s_i nil)
- )
- (setq temp (sslength sset)
- j 0
- )
- (if (= (getvar "cvport") 1)
- (command "mspace")
- )
- (while (< j temp)
- (progn
- (setq vp_n (cdr(assoc 69 (entget(ssname sset j)))))
- (setvar "cvport" vp_n)
- (setq j (1+ j))
- (if (or vp_s_i (< j 2))
- (mv_ssi)
- )
- (command "zoom" (strcat (mv_sts vp_scale) "xp"))
- )
- )
- (command "pspace")
- )
- (princ "\n\tNo viewports selected. ")
- )
- (command "undo" "en")
- )
- ;;;
- ;;; Interactively set the scale of each viewport.
- ;;;
- ;;; mv_ssi == MView_Setup_Scale_Interactively
- ;;;
- (defun mv_ssi (/ ans)
- (princ "\n\tEnter the ratio of paper space units to model space units... ")
- (initget 6)
- (setq ans (getreal
- "\n\tNumber of paper space units. <1.0>: ")
- )
- (if (= (type ans) 'REAL)
- (setq vp_scale ans)
- (setq vp_scale 1.0)
- )
- (initget 6)
- (setq ans (getreal
- "\n\tNumber of model space units. <1.0>: ")
- )
- (if (= (type ans) 'REAL)
- (setq vp_scale (/ vp_scale ans))
- (setq vp_scale (/ vp_scale 1.0))
- )
- vp_scale
- )
- ;;;
- ;;; Set up the scale either interactively or uniformly.
- ;;;
- ;;; mv_sus == MView_Set_Up_Scale
- ;;;
- (defun mv_sus ()
- (if vp_s_i
- (mv_ssi)
- )
- (setq vp (mv_gvp (+ n vp_n) sset))
- (command "zoom" (strcat (mv_sts vp_scale) "xp"))
- )
- ;;;
- ;;; Convert a real number to its shortest value; no trailing zeros.
- ;;;
- ;;; mv_sts == MView_Scale_To_String
- ;;;
- (defun mv_sts (num / scale j return)
- (setq scale (rtos num 2 15)
- j 0
- )
- (while (< j (strlen scale))
- (if (= (setq return (substr scale (- (strlen scale) j) 1)) "0")
- (setq j (1+ j))
- (if (= return ".")
- (progn
- (setq return (substr scale 1 (- (strlen scale) (1- j))))
- (setq j (strlen scale))
- )
- (progn
- (setq return (substr scale 1 (- (strlen scale) j)))
- (setq j (strlen scale))
- )
- )
- )
- )
- return
- )
- ;;;
- ;;; Change to a new plan view and restore.
- ;;;
- ;;; mv_npv == MView_set_New_Plan_View
- ;;;
- (defun mv_npv (ord_1 amnt_1 ord_2 amnt_2)
- (command "ucs" ord_1 amnt_1)
- (command "ucs" ord_2 amnt_2)
- (command "plan" "" )
- (command "ucs" "p")
- (command "ucs" "p")
- (princ)
- )
- ;;;
- ;;;Get the Mview viewport whose number we have in vp_n.
- ;;;
- ;;; mv_gvp == MView_Get_ViewPort
- ;;;
- (defun mv_gvp (num sset / j vp ss_len cont)
- (setq ss_len (sslength sset)
- j 0
- cont T
- )
- (while (and cont (< j ss_len))
- (if (= (cdr(assoc 69 (setq vp (entget (ssname sset j))))) num)
- (setq cont nil)
- )
- (setq j (1+ j))
- )
- vp
- )
- ;;;
- ;;; Change the view into all Mview viewports.
- ;;;
- ;;; mv_cav == MView_Change_All_Views
- ;;;
- (defun mv_cav (/ n sset vp_n vp)
- (if need_z
- (command "zoom" "e")
- )
- (setq n 0
- sset (ssget "x" '((0 . "VIEWPORT")))
- vp_n f_vp_n
- )
- (command "mspace")
- ;;(setvar "cvport" vp_n)
- ;; While we still have both viewports and view definitions for them...
- (while (and (< n view_n) (<= (+ n vp_n) l_vp_n))
- (setvar "cvport" (+ n vp_n))
- (setq vp (mv_gvp (+ n vp_n) sset))
- (cond
- ((= (nth (+ 3 n) vp_item_list) "PLAN")
- (command "plan" "")
- ;;(mv_sus)
- )
- ((= (nth (+ 3 n) vp_item_list) "FRONT")
- (mv_npv "x" "90" "x" "0")
- ;;(mv_sus)
- )
- ((= (nth (+ 3 n) vp_item_list) "RIGHT")
- (mv_npv "z" "90" "x" "90")
- ;;(mv_sus)
- )
- ((= (nth (+ 3 n) vp_item_list) "LEFT")
- (mv_npv "z" "-90" "x" "90")
- ;;(mv_sus)
- )
- ((= (nth (+ 3 n) vp_item_list) "ISO")
- (command "vpoint" "r" "-45" "30")
- ;;(mv_sus)
- )
- (T
- (princ "\n\tUndefined view definition in default file. ")
- (exit)
- )
- )
- (setq n (1+ n))
- )
- (command "pspace")
- )
- ;;;
- ;;; Array other Mview viewports.
- ;;;
- ;;; mv_avp == MView_Array_ViewPorts
- ;;;
- (defun mv_avp ( / dx dy)
- (if (and (> (car mvs_p4) 1) (> (cadr mvs_p4) 1))
- (progn
- (setq dx (+ (car mvs_p5) (car mvs_p3)))
- (setq dy (+ (cadr mvs_p5) (cadr mvs_p3)))
- (command "array"
- (entlast) ""
- "r"
- (cadr mvs_p4)
- (car mvs_p4)
- (+ (cadr mvs_p5) (cadr mvs_p3))
- (+ (car mvs_p5) (car mvs_p3))
- )
- )
- (if (> (car mvs_p4) 1)
- (progn
- (setq dx (+ (car mvs_p5) (car mvs_p3)))
- (command "array"
- (entlast) ""
- "r"
- (cadr mvs_p4)
- (car mvs_p4)
- (+ (car mvs_p5) (car mvs_p3))
- )
- )
- (if (> (cadr mvs_p4) 1)
- (progn
- (setq dy (+ (cadr mvs_p5) (cadr mvs_p3)))
- (command "array"
- (entlast) ""
- "r"
- (cadr mvs_p4)
- (car mvs_p4)
- (+ (cadr mvs_p5) (cadr mvs_p3))
- )
- )
- )
- )
- )
- )
- ;;;
- ;;; Get the name of a Mview viewport.
- ;;;
- ;;; mv_gvn == MView_Get_Viewport_Name
- ;;;
- (defun mv_gvn ()
- (cdr(assoc 69 (entget(entlast))))
- )
- ;;;
- ;;; Calculate the size of the individual viewports from the two
- ;;; corner points, mvs_p1 and mvs_p2, the interstitial distances
- ;;; held in mvs_p3, and the number of viewports held in mvs_p4.
- ;;;
- ;;; mv_cfp == MView_Calculate_First_Points
- ;;;
- (defun mv_cfp (/ x y dx dy )
- (if (> (car mvs_p1) (car mvs_p2))
- (setq x (car mvs_p1)
- mvs_p1 (list (car mvs_p2) (cadr mvs_p1) 0.0)
- mvs_p2 (list x (cadr mvs_p2) 0.0)
- )
- )
- (if (> (cadr mvs_p1) (cadr mvs_p2))
- (setq x (cadr mvs_p1)
- mvs_p1 (list (car mvs_p1) (cadr mvs_p2) 0.0)
- mvs_p2 (list (car mvs_p2) x 0.0)
- )
- )
- ;; Points are now sorted so that mvs_p1 IS lower left....
- (setq x (- (car mvs_p2) (car mvs_p1))
- y (- (cadr mvs_p2) (cadr mvs_p1))
- dx (/ (- x (* (1- (car mvs_p4)) (car mvs_p3))) (car mvs_p4))
- dy (/ (- y (* (1- (cadr mvs_p4)) (cadr mvs_p3))) (cadr mvs_p4))
- p1 mvs_p1
- p2 (mapcar '+ p1 (setq mvs_p5 (list dx dy 0)))
- )
- )
- ;;;
- ;;; Get the number of viewports in X and Y.
- ;;; Sets the global mvs_p4 which is a point containing the X and Y
- ;;; amounts as the (car) and (cadr) of mvs_p4.
- ;;;
- ;;; mv_gnv == MView_Get_Number_of_Viewports_in_x_and_y
- ;;;
- (defun mv_gnv (/ )
- (if n_vp_x
- (progn
- (setq mvs_p4 (list (read n_vp_x) (read n_vp_y) 0))
- )
- (progn
- (setq ans (getint "\n\tNumber of viewports in X. <1>: "))
- (if (= (type ans) 'INT)
- (setq mvs_p4 (list ans))
- (setq mvs_p4 (list 1))
- )
- (setq ans (getint "\n\tNumber of viewports in Y. <1>: "))
- (if (= (type ans) 'INT)
- (setq mvs_p4 (append mvs_p4 (list ans 0)))
- (setq mvs_p4 (append mvs_p4 (list 1 0)))
- )
- )
- )
- )
- ;;;
- ;;; Get the horizontal and vertical distances between the viewports.
- ;;; Sets the global mvs_p3 which is a point containing the X and Y
- ;;; interstitial distances as the (car) and (cadr) of mvs_p3.
- ;;;
- ;;; mv_gid == MView_Get_Interstitial_Distances
- ;;;
- (defun mv_gid (/ )
- (setq mvs_p3 (list 0.0 0.0 0.0))
- (if (> (car mvs_p4) 1)
- (progn
- (setq ans (getdist (strcat
- "\n\tDistance between viewports in X. <"
- (mv_sts (car mvs_p3))
- ">: ")))
- (if (= (type ans) 'REAL)
- (setq mvs_p3 (list ans ans ans))
- )
- )
- )
- (if (> (cadr mvs_p4) 1)
- (progn
- (setq ans (getdist (strcat
- "\n\tDistance between viewports in Y. <"
- (mv_sts (cadr mvs_p3))
- ">: ")))
- (if (= (type ans) 'REAL)
- (setq mvs_p3 (list (car mvs_p3) ans (caddr mvs_p3)))
- )
- )
- )
- mvs_p3
- )
- ;;;
- ;;; Get set up for creating viewports.
- ;;; Sets the globals mvs_p1 and mvs_p2 which are the corners of the
- ;;; allowable area for viewports in paperspace coordinates.
- ;;;
- ;;; mv_gba == MView_Get_Bounding_Area
- ;;;
- (defun mv_gba (/ )
- (if ll_crn
- (initget 1 "Default")
- (initget 1)
- )
- (graphscr)
- (setq ans (getpoint
- (if ll_crn
- "\n\tBounding area for viewports. Default/<First point >: "
- "\n\tBounding area for viewports. First point: "
- )
- ))
- (if (= ans "Default")
- (progn
- (if ll_crn
- (setq mvs_p1 (read ll_crn)
- mvs_p2 (read ur_crn)
- )
- (progn
- (princ "\n\tNo default points defined. ")
- (exit)
- )
- )
- )
- (progn
- (initget 1)
- (setq mvs_p1 ans
- mvs_p2 (getcorner mvs_p1 "\n\tOther point: ")
- )
- )
- )
- )
- ;;;
- ;;; Check that the corners given are on-screen. If not, zoom so they are.
- ;;;
- ;;; mv_cba == MView_Check_Bounding_Area
- ;;;
- (defun mv_cba (/ vs vc ss dx dy)
- (setq vs (getvar "viewsize")
- vc (getvar "viewctr")
- ss (getvar "screensize")
- dx (* vs (/ (car ss) (cadr ss)))
- )
- (if (or (< (car mvs_p1) (- (car vc) (/ dx 2.0)))
- (< (cadr mvs_p1) (- (cadr vc) (/ vs 2.0)))
- (> (car mvs_p2) (+ (car vc) (/ dx 2.0)))
- (> (cadr mvs_p2) (+ (cadr vc) (/ vs 2.0)))
- )
- (setq need_z T)
- )
- )
- ;;;
- ;;; Create a title block or Mview viewport layout from the code in the
- ;;; default file. This may be anything from inserting a block to actually
- ;;; drawing every component of the title block from scratch. Any
- ;;; single-line valid Lisp expression may be written in the default file
- ;;; after the DATA name.
- ;;;
- ;;; mv_cfd == MView_Create_From_Defaults
- ;;;
- (defun mv_cfd (/ cont theCmd)
- (setq cont T)
- (while cont
- (setq theCmd (mv_rpl))
- (if (= (substr theCmd 1 8) "END_ITEM")
- (progn
- (setq cont nil)
- )
- (mv_etl theCmd)
- )
- )
- )
- ;;;
- ;;; Evaluate the line or string passed in.
- ;;;
- ;;; mv_etl == MView_Evaluate_The_Line
- ;;;
- (defun mv_etl (str / )
- ;(princ str)(terpri)
- (if (eval(read str)) T nil)
- )
- ;;;
- ;;; Read and parse out a line of the Lisp code found in the defaults
- ;;; file. This must be done so that literal strings may be written
- ;;; directly in the defaults file, without having to escape all of them.
- ;;; We will do the escaping here, if necessary.
- ;;;
- ;;; Return the escaped string
- ;;;
- ;;; mv_rpl == MView_Read_and_Parse_a_Line
- ;;;
- (defun mv_rpl ( / line j k sl str)
- (if (setq line (read-line deffi))
- (progn
- (setq j 1 k 1 sl (strlen line) str "")
- (while (<= j sl)
- (if (= (setq sb_str (substr line j k)) "\"")
- (setq str (strcat str "\""))
- (setq str (strcat str sb_str))
- )
- (setq j (1+ j))
- )
- )
- (progn
- (princ "\n\tNo lines left to read. ")
- (exit)
- )
- )
- str
- )
- ;;;
- ;;; Create a default definitions file in the current directory
- ;;; Read it out of this file (mvsetup.lsp) at the end of the file.
- ;;;
- ;;; mv_cdf == MView_Create_Defaults_File
- ;;;
- (defun mv_cdf (/ deffi deffo cont line)
- ;; The default file name for mvsetup is "mvsetup.dfs".
- ;; Look for it in AutoCAD's search paths
- ;;
- (if (setq deffi (mv_lfx "mvsetup.lsp" "r"))
- (if (setq deffo (mv_lfx mv_xdf "w"))
- (progn
- (setq cont T)
- (while cont
- (setq line (read-line deffi))
- ;; Seek to the start of the default file definition
- (if (= (substr line 1 13) ";;; Start DDF")
- (setq cont nil)
- )
- )
- ;; Start writing the file
- ;; Throw away the first four characters of each line to the EOF.
-
- (while (setq line (read-line deffi))
- ;; Seek to the start of the default file definition
- (write-line (substr line 5) deffo)
- )
- (setq deffi (close deffi))
- (setq deffo (close deffo))
- )
- (princ (strcat "\nError opening " mv_xdf " for writing. "))
- )
- (princ (strcat "\nError opening " mv_xlf " for reading. "))
- )
- )
- ;;;
- ;;; Look for an external definitions file in AutoCAD's search path
- ;;;
- ;;; mv_lfx == MView_Look_For_eXternal_file
- ;;;
- (defun mv_lfx (f_name r_or_w / lfile)
- ;; Look for f_name in AutoCAD's search paths.
- (if (= r_or_w "w")
- (if (setq temp (open f_name r_or_w))
- temp ; Return file descriptor
- (progn
- (princ (strcat "\n\tCouldn't open " f_name " for writing. "))
- (exit)
- )
- )
- (if (setq lfile (findfile f_name))
- (if (setq temp (open lfile r_or_w))
- temp ; Return file descriptor
- (progn
- (princ (strcat "\n\tCouldn't open " f_name " for reading. "))
- (exit)
- )
- )
- nil ; or nil
- )
- )
- )
- ;;;
- ;;; Change an existing setup, including the titleblock and/or viewports
- ;;;
- ;;; mv_coc == MView_Change_Or_Create?
- ;;;
- (defun mv_coc ()
- (initget "Create Update")
- (setq ans (getkword "\n\tUpdate current setup/<Create>: "))
- (if (= ans "Update")
- -1 ; Return -1
- 1 ; Return 1
- )
- )
- ;;;
- ;;; Do the old Release 10 setup -- we are in Release 10 mode.
- ;;;
- ;;; mv_ == MView_
- ;;;
- (defun mv_dos (/ temp xl yl)
-
- (princ "\n\tTILEMODE is set to 1; cannot set up paperspace/modelspace")
- (princ "\n\tviewports unless TILEMODE is set to 0. Release 10 setup: \n")
-
- (menucmd "S=UNITS")
-
- (initget 7) ; No null input, negative or zero values
-
- (setq temp (getint "\n\tSelect the Units from the screen menu: "))
- (menucmd (strcat "S=U" (itoa temp)))
-
- (setq mv_olu (getvar "lunits")) ; Store current linear units setting
- (if (= temp 5) ; Set linear units to new value
- (setvar "lunits" 2) ; If metric
- (setvar "lunits" temp) ; otherwise
- )
-
- (initget 5) ; 0 ok, but no null or negative values
-
- (setq mv_sc (getreal "\n\tSelect the Scale from the screen menu: "))
- (cond
- ((= mv_sc 0)
- (progn
- (initget 7)
- (setq mv_sc (getreal "\n\tEnter the scale: "))
- (setq mv_sc (float mv_sc))
- )
- )
- )
- (cond
- ((= temp 5)
- (menucmd "S=METRIC")
- )
- (T
- (menucmd "S=ENGLISH")
- )
- )
- (initget 5) ; 0 ok, but no null or negative values
- (setq xl (getdist "\n\tSelect the Paper size from the screen menu: "))
- (initget 5) ; 0 ok, but no null or negative values
- (setq yl (getdist))
- (cond
- ((= xl 0)
- (progn
- (initget 7) ; No null, negative or zero values
- (setq xl (getdist "\n\tEnter the Horizontal Dimension of the paper: "))
- (initget 7) ; No null, negative or zero values
- (setq yl (getdist "\n\tEnter the Vertical Dimension of the paper: "))
- )
- )
- )
- (setq xl (* mv_sc xl)
- yl (* mv_sc yl)
- )
- (command
- "limits" "0,0" (list xl yl)
- "pline" "0,0" (list 0 yl) (list xl yl) (list xl 0) "0,0" "c"
- "zoom" "a"
- )
- (menucmd "S=")
- (menucmd "S=")
- (menucmd "S=")
- )
- ;;;
- ;;; C: function definition.
- ;;;
- (defun c:mvs () (vmon)(mv_sup))
- (defun c:mvsetup () (vmon)(mv_sup))
- (princ "\n\tC:MVSetup loaded. Type MVS or MVSETUP to set up your drawing.")
- (princ)
-
- ;;;
- ;;; The rest of this file in source form is the default file. When creating
- ;;; a default file, each line following the line which contains "Start DDF"
- ;;; is read and written to the default file minus its first four characters.
- ;;;
- ;;; This file contains definitions for ANSI A through E size title block
- ;;; sheets and several viewport setup options. If this file is ever
- ;;; Kelvinated or protected, then this section should be stripped out and
- ;;; shipped separately. Some code changes would also be required.
- ;;;
-
- ;;; Start DDF
- ;;; ;;; Do NOT erase or change the first three lines
- ;;; ;;; Version 1.0 -- (c) Autodesk, Inc. 26 February 1990
- ;;; ;;; MetaView Setup Defaults
- ;;; ;;; This file contains sets of defaults for setting up multiple viewport
- ;;; ;;; configurations in Paperspace in Release 11 of AutoCAD. It is intended
- ;;; ;;; that you modify the entries given here to create your own customized
- ;;; ;;; versions. The format of the file is as follows:
- ;;; ;;;
- ;;; ;;; The first part of the file is a list of the NAME's of the entries
- ;;; ;;; followed by an END_NAMES delimiter.
- ;;; ;;;
- ;;; ;;; Each of the names may have optional, comma delimited fields in the
- ;;; ;;; following order: the first optional field is the file/path name of
- ;;; ;;; an AutoCAD drawing which is to be inserted at the local UCS origin
- ;;; ;;; when the name is selected, followed by a window in paperspace units
- ;;; ;;; which represents the extents (in paperspace) of the usable paper
- ;;; ;;; area. This is the area which may be automatically filled with
- ;;; ;;; viewports.
- ;;; ;;;
- ;;; ;;; The data portion of the file for any NAME entry is of arbitrary
- ;;; ;;; length, and contains lines of AutoLISP code with all coordinates
- ;;; ;;; in Paperspace units. It is terminated with END_DATA.
- ;;; ;;;
- ;;; ;;; Lines of AutoLisp code cannot be split across multiple lines.
- ;;; ;;;
- ;;; ;;; Lines may be commented out with ";".
- ;;;
- ;;; NAMES
- ;;; None
- ;;; ANSI-V Size ,ansi-v.dwg,(0.505 2.125 0.0),(7.995 9.5777 0.0)
- ;;; ANSI-A Size ,ansi-a.dwg,(0.375 2.255 0.0),(10.625 6.9477 0.0)
- ;;; ANSI-B Size ,ansi-b.dwg,(0.745 0.505 0.0),(10.005 10.495 0.0)
- ;;; ANSI-C Size ,ansi-c.dwg,(0.625 0.875 0.0),(15.125 16.125 0.0)
- ;;; ANSI-D Size ,ansi-d.dwg,(1.125 0.625 0.0),(25.255 21.375 0.0)
- ;;; ANSI-E Size ,ansi-e.dwg,(0.625 1.125 0.0),(35.755 32.875 0.0)
- ;;; Arch/Engineering (24 x 36) ,arch-a.dwg,(1.0 1.0 0.0),(30.5 23.0 0.0)
- ;;; END_NAMES
- ;;;
- ;;; DATA
- ;;;
- ;;; NAME - None
- ;;; (princ)
- ;;; END_ITEM
- ;;;
- ;;; An ANSI - A size Vertical sheet with Title block and revision bar.
- ;;; All points are in paperspace units at a scale of 1 inch.
- ;;;
- ;;; NAME - ANSI-V Size
- ;;; (command "zoom" "w" "-0.5,-0.5" "9.0,11.5")
- ;;; (command "line" "0,0" "8.5,0" "8.5,11" "0,11" "C")
- ;;; (command "line" ".38,.25" "8.12,.25" "8.12,10.75" ".38,10.75" "C")
- ;;; ;;; Bottom microfilm alignment arrow
- ;;; (command "pline" "4.25,0" "w" "0.02" "" "4.25,.1" "")
- ;;; (command "solid" "4.1,.1" "4.4,.1" "4.25,.25" "" "")
- ;;; ;;; Right microfilm alignment arrow
- ;;; (command "pline" "8.37,5.5" "w" "0.02" "" "8.27,5.5" "")
- ;;; (command "solid" "8.27,5.35" "8.27,5.65" "8.12,5.5" "" "")
- ;;; ;;; Top microfilm alignment arrow
- ;;; (command "pline" "4.25,11" "w" "0.02" "" "4.25,10.9" "")
- ;;; (command "solid" "4.1,10.9" "4.4,10.9" "4.25,10.75" "" "")
- ;;; ;;; Left microfilm alignment arrow
- ;;; (command "pline" ".13,5.5" "w" "0.02" "" ".23,5.5" "")
- ;;; (command "solid" ".23,5.35" ".23,5.65" ".38,5.5" "" "")
- ;;; ;;;
- ;;; ;;; Title block
- ;;; ;;;
- ;;; ;;; Horizontals
- ;;; (command "line" "1.87,0.25" "1.87,2" "8.12,2" "")
- ;;; (command "line" "1.87,.565" "3.87,.565" "")
- ;;; (command "line" "1.87,.88" "8.12,.88" "")
- ;;; (command "line" "3.87,.5" "8.12,.5" "")
- ;;; (command "line" "3.87,1.5" "8.12,1.5" "")
- ;;; ;;;
- ;;; ;;; Verticals
- ;;; (command "line" "3.87,0.25" "3.87,2" "")
- ;;; (command "line" "4.87,.25" "4.87,.5" "")
- ;;; (command "line" "6.37,.25" "6.37,.5" "")
- ;;; (command "line" "4.25,.5" "4.25,.88" "")
- ;;; (command "line" "5.37,.5" "5.37,.88" "")
- ;;; (command "line" "7.74,.5" "7.74,.88" "")
- ;;; ;;;
- ;;; ;;; Text
- ;;; (command "style" "adesk1" "romans" "0" "1.0" "0" "" "" "")
- ;;; (command "text" "3.9223,.3425" "0.065" "0" "SCALE")
- ;;; (command "text" "6.4228,.3425" "0.065" "0" "SHEET")
- ;;; (command "text" "3.9579,.7659" "0.065" "0" "SIZE")
- ;;; (command "text" "4.3189,.7659" "0.065" "0" "FSCM NO.")
- ;;; (command "text" "5.4410,.7659" "0.065" "0" "DWG NO.")
- ;;; (command "text" "7.8205,.7659" "0.065" "0" "REV")
- ;;; ;;;
- ;;; ;;; Revision bar
- ;;; ;;;
- ;;; ;;; Horizontals
- ;;; (command "line" "2.62,10.5" "8.12,10.5" "")
- ;;; (command "line" "2.62,10.25" "8.12,10.25" "")
- ;;; ;;;
- ;;; ;;; Verticals
- ;;; (command "line" "2.62,10.75" "2.62,9.7027" "")
- ;;; (command "line" "3.12,10.25" "3.12,10.5" "")
- ;;; (command "line" "3.50,10.25" "3.50,10.5" "")
- ;;; (command "line" "6.24,10.25" "6.24,10.5" "")
- ;;; (command "line" "7.12,10.25" "7.12,10.5" "")
- ;;; ;;;
- ;;; ;;; Revision bar text
- ;;; ;;;
- ;;; (command "text" "5.3302,10.5825" "0.065" "0" "REVISIONS")
- ;;; (command "text" "2.7287,10.3403" "0.065" "0" "ZONE")
- ;;; (command "text" "3.2001,10.3403" "0.065" "0" "REV")
- ;;; (command "text" "4.5020,10.3403" "0.065" "0" "DESCRIPTION")
- ;;; (command "text" "6.5677,10.3403" "0.065" "0" "DATE")
- ;;; (command "text" "7.3614,10.3403" "0.065" "0" "APPROVED")
- ;;; END_ITEM
- ;;;
- ;;; An ANSI - A size sheet with Title block and revision bar.
- ;;; All points are in paperspace units at a scale of 1 inch.
- ;;;
- ;;; NAME - ANSI-A Size
- ;;; (command "zoom" "w" "-0.5,-0.5" "11.5,9.0")
- ;;; (command "line" "0,0" "11,0" "11,8.5" "0,8.5" "C")
- ;;; (command "line" ".25,.38" "10.75,.38" "10.75,8.12" ".25,8.12" "C")
- ;;; ;;; Bottom microfilm alignment arrow
- ;;; (command "pline" "5.5,.13" "w" "0.02" "" "5.5,.23" "")
- ;;; (command "solid" "5.35,.23" "5.65,.23" "5.5,.38" "" "")
- ;;; ;;; Right microfilm alignment arrow
- ;;; (command "pline" "11,4.25" "w" "0.02" "" "10.9,4.25" "")
- ;;; (command "solid" "10.9,4.1" "10.9,4.4" "10.75,4.25" "" "")
- ;;; ;;; Top microfilm alignment arrow
- ;;; (command "pline" "5.5,8.37" "w" "0.02" "" "5.5,8.27" "")
- ;;; (command "solid" "5.35,8.27" "5.65,8.27" "5.5,8.12" "" "")
- ;;; ;;; Left microfilm alignment arrow
- ;;; (command "pline" "0,4.25" "w" "0.02" "" ".1,4.25" "")
- ;;; (command "solid" ".1,4.1" ".1,4.4" ".25,4.25" "" "")
- ;;; ;;;
- ;;; ;;; Title block
- ;;; ;;;
- ;;; ;;; Horizontals
- ;;; (command "line" "4.5,.38" "4.5,2.13" "10.75,2.13" "")
- ;;; (command "line" "4.5,.695" "6.5,.695" "")
- ;;; (command "line" "4.5,1.01" "10.75,1.01" "")
- ;;; (command "line" "6.5,.63" "10.75,.63" "")
- ;;; (command "line" "6.5,1.63" "10.75,1.63" "")
- ;;; ;;;
- ;;; ;;; Verticals
- ;;; (command "line" "6.5,0.38" "6.5,2.13" "")
- ;;; (command "line" "7.5,.38" "7.5,.63" "")
- ;;; (command "line" "9.0,.38" "9.0,.63" "")
- ;;; (command "line" "6.88,.63" "6.88,1.01" "")
- ;;; (command "line" "8,.63" "8,1.01" "")
- ;;; (command "line" "10.37,.63" "10.37,1.01" "")
- ;;; ;;;
- ;;; ;;; Text
- ;;; (command "style" "adesk1" "romans" "0" "1.0" "0" "" "" "")
- ;;; (command "text" "6.5523,0.4725" "0.065" "0" "SCALE")
- ;;; (command "text" "9.0528,0.4725" "0.065" "0" "SHEET")
- ;;; (command "text" "6.5879,0.8959" "0.065" "0" "SIZE")
- ;;; (command "text" "6.9489,0.8959" "0.065" "0" "FSCM NO.")
- ;;; (command "text" "8.0710,0.8959" "0.065" "0" "DWG NO.")
- ;;; (command "text" "10.4505,0.8959" "0.065" "0" "REV")
- ;;; ;;;
- ;;; ;;; Revision bar
- ;;; ;;;
- ;;; ;;; Horizontals
- ;;; (command "line" "5.25,7.87" "10.75,7.87" "")
- ;;; (command "line" "5.25,7.62" "10.75,7.62" "")
- ;;; ;;;
- ;;; ;;; Verticals
- ;;; (command "line" "5.25,8.12" "5.25,7.0727" "")
- ;;; (command "line" "5.75,7.62" "5.75,7.87" "")
- ;;; (command "line" "6.13,7.62" "6.13,7.87" "")
- ;;; (command "line" "8.87,7.62" "8.87,7.87" "")
- ;;; (command "line" "9.75,7.62" "9.75,7.87" "")
- ;;; ;;;
- ;;; ;;; Revision bar text
- ;;; ;;;
- ;;; (command "text" "7.9602,7.9525" "0.065" "0" "REVISIONS")
- ;;; (command "text" "5.3587,7.7103" "0.065" "0" "ZONE")
- ;;; (command "text" "5.8301,7.7103" "0.065" "0" "REV")
- ;;; (command "text" "7.1320,7.7103" "0.065" "0" "DESCRIPTION")
- ;;; (command "text" "9.1977,7.7103" "0.065" "0" "DATE")
- ;;; (command "text" "9.9914,7.7103" "0.065" "0" "APPROVED")
- ;;; END_ITEM
- ;;;
- ;;; An ANSI - B size sheet with Title block and revision bar.
- ;;; All points are in paperspace units at a scale of 1 inch.
- ;;;
- ;;; NAME - ANSI-B Size
- ;;; (command "zoom" "w" "-0.5,-0.5" "17.5,11.5")
- ;;; (command "line" "0,0" "17,0" "17,11" "0,11" "C")
- ;;; (command "line" ".62,.38" "16.38,.38" "16.38,10.62" ".62,10.62" "C")
- ;;; ;;; Bottom microfilm alignment arrow
- ;;; (command "pline" "8.5,.13" "w" "0.02" "" "8.5,.23" "")
- ;;; (command "solid" "8.35,.23" "8.65,.23" "8.5,.38" "" "")
- ;;; ;;; Right microfilm alignment arrow
- ;;; (command "pline" "16.62,5.5" "w" "0.02" "" "16.52,5.5" "")
- ;;; (command "solid" "16.52,5.35" "16.52,5.65" "16.38,5.5" "" "")
- ;;; ;;; Top microfilm alignment arrow
- ;;; (command "pline" "8.5,10.87" "w" "0.02" "" "8.5,10.77" "")
- ;;; (command "solid" "8.35,10.77" "8.65,10.77" "8.5,10.62" "" "")
- ;;; ;;; Left microfilm alignment arrow
- ;;; (command "pline" ".38,5.5" "w" "0.02" "" ".48,5.5" "")
- ;;; (command "solid" ".48,5.35" ".48,5.65" ".62,5.5" "" "")
- ;;; ;;;
- ;;; ;;; Title block
- ;;; ;;;
- ;;; ;;; Horizontals
- ;;; (command "line" "10.13,.38" "10.13,2.13" "16.38,2.13" "")
- ;;; (command "line" "10.13,.695" "12.13,.695" "")
- ;;; (command "line" "10.13,1.01" "16.38,1.01" "")
- ;;; (command "line" "12.13,.63" "16.38,.63" "")
- ;;; (command "line" "12.13,1.63" "16.38,1.63" "")
- ;;; ;;;
- ;;; ;;; Verticals
- ;;; (command "line" "12.13,0.38" "12.13,2.13" "")
- ;;; (command "line" "13.13,.38" "13.13,.63" "")
- ;;; (command "line" "14.63,.38" "14.63,.63" "")
- ;;; (command "line" "12.51,.63" "12.51,1.01" "")
- ;;; (command "line" "13.63,.63" "13.63,1.01" "")
- ;;; (command "line" "16,.63" "16,1.01" "")
- ;;; ;;;
- ;;; ;;; Text
- ;;; (command "style" "adesk1" "romans" "0" "1.0" "0" "" "" "")
- ;;; (command "text" "12.1823,0.4725" "0.065" "0" "SCALE")
- ;;; (command "text" "14.6828,0.4725" "0.065" "0" "SHEET")
- ;;; (command "text" "12.2179,0.8959" "0.065" "0" "SIZE")
- ;;; (command "text" "12.5789,0.8959" "0.065" "0" "FSCM NO.")
- ;;; (command "text" "13.7010,0.8959" "0.065" "0" "DWG NO.")
- ;;; (command "text" "16.0805,0.8959" "0.065" "0" "REV")
- ;;; ;;;
- ;;; ;;; Revision bar
- ;;; ;;;
- ;;; ;;; Horizontals
- ;;; (command "line" "10.88,10.37" "16.38,10.37" "")
- ;;; (command "line" "10.88,10.12" "16.38,10.12" "")
- ;;; ;;;
- ;;; ;;; Verticals
- ;;; (command "line" "10.88,10.62" "10.88,9.5727" "")
- ;;; (command "line" "11.38,10.12" "11.38,10.37" "")
- ;;; (command "line" "11.76,10.12" "11.76,10.37" "")
- ;;; (command "line" "14.5,10.12" "14.5,10.37" "")
- ;;; (command "line" "15.38,10.12" "15.38,10.37" "")
- ;;; ;;;
- ;;; ;;; Revision bar text
- ;;; ;;;
- ;;; (command "text" "13.5902,10.4525" "0.065" "0" "REVISIONS")
- ;;; (command "text" "10.9887,10.2103" "0.065" "0" "ZONE")
- ;;; (command "text" "11.4601,10.2103" "0.065" "0" "REV")
- ;;; (command "text" "12.7620,10.2103" "0.065" "0" "DESCRIPTION")
- ;;; (command "text" "14.8277,10.2103" "0.065" "0" "DATE")
- ;;; (command "text" "15.6214,10.2103" "0.065" "0" "APPROVED")
- ;;; END_ITEM
- ;;;
- ;;; An ANSI - C size sheet with Title block and revision bar.
- ;;; All points are in paperspace units at a scale of 1 inch.
- ;;;
- ;;; NAME - ANSI-C Size
- ;;; (command "zoom" "w" "-0.5,-0.5" "22.5,17.5")
- ;;; (command "line" "0,0" "22,0" "22,17" "0,17" "C")
- ;;; (command "line" ".5,.75" "21.5,.75" "21.5,16.25" ".5,16.25" "C")
- ;;; (command "line" "5.5,0.375" "5.5,0.75" "")
- ;;; (command "array" (entlast) "" "R" "2" "2" "15.875" "11")
- ;;; (command "line" "0.125,4.25" "0.5,4.25" "")
- ;;; (command "array" (entlast) "" "R" "2" "2" "8.5" "21.375")
- ;;; ;;;
- ;;; ;;; Bottom microfilm alignment arrow
- ;;; (command "pline" "11,.5" "w" "0.02" "" "11,.6" "")
- ;;; (command "solid" "10.85,.6" "11.15,.6" "11,.75" "" "")
- ;;; ;;; Right microfilm alignment arrow
- ;;; (command "pline" "21.75,8.5" "w" "0.02" "" "21.65,8.5" "")
- ;;; (command "solid" "21.65,8.35" "21.65,8.65" "21.5,8.5" "" "")
- ;;; ;;; Top microfilm alignment arrow
- ;;; (command "pline" "11,16.5" "w" "0.02" "" "11,16.4" "")
- ;;; (command "solid" "10.85,16.4" "11.15,16.4" "11,16.25" "" "")
- ;;; ;;; Left microfilm alignment arrow
- ;;; (command "pline" ".25,8.5" "w" "0.02" "" ".35,8.5" "")
- ;;; (command "solid" ".35,8.35" ".35,8.65" ".5,8.5" "" "")
- ;;; ;;;
- ;;; ;;; Title block
- ;;; ;;;
- ;;; ;;; Horizontals
- ;;; (command "line" "15.25,0.75" "15.25,2.5" "21.50,2.5" "")
- ;;; (command "line" "15.25,1.065" "17.25,1.065" "")
- ;;; (command "line" "15.25,1.38" "21.5,1.38" "")
- ;;; (command "line" "17.25,1" "21.5,1" "")
- ;;; (command "line" "17.25,2" "21.5,2" "")
- ;;; ;;;
- ;;; ;;; Verticals
- ;;; (command "line" "17.25,0.75" "17.25,2.5" "")
- ;;; (command "line" "18.25,0.75" "18.25,1" "")
- ;;; (command "line" "19.75,0.75" "19.75,1" "")
- ;;; (command "line" "17.63,1" "17.63,1.38" "")
- ;;; (command "line" "18.75,1" "18.75,1.38" "")
- ;;; (command "line" "21.12,1" "21.12,1.38" "")
- ;;; ;;;
- ;;; ;;; Text
- ;;; (command "style" "adesk1" "romans" "0" "1.0" "0" "" "" "")
- ;;; (command "text" "17.3023,0.8425" "0.065" "0" "SCALE")
- ;;; (command "text" "19.8028,0.8425" "0.065" "0" "SHEET")
- ;;; (command "text" "17.3379,1.2659" "0.065" "0" "SIZE")
- ;;; (command "text" "17.6989,1.2659" "0.065" "0" "FSCM NO.")
- ;;; (command "text" "18.8210,1.2659" "0.065" "0" "DWG NO.")
- ;;; (command "text" "21.2005,1.2659" "0.065" "0" "REV")
- ;;; ;;;
- ;;; ;;; Revision bar
- ;;; ;;;
- ;;; ;;; Horizontals
- ;;; (command "line" "16,16" "21.5,16" "")
- ;;; (command "line" "16,15.75" "21.5,15.75" "")
- ;;; ;;;
- ;;; ;;; Verticals
- ;;; (command "line" "16,16.25" "16,15.2027" "")
- ;;; (command "line" "16.5,15.75" "16.5,16" "")
- ;;; (command "line" "16.88,15.75" "16.88,16" "")
- ;;; (command "line" "19.62,15.75" "19.62,16" "")
- ;;; (command "line" "20.5,15.75" "20.5,16" "")
- ;;; ;;;
- ;;; ;;; Revision bar text
- ;;; ;;;
- ;;; (command "text" "18.7102,16.0825" "0.065" "0" "REVISIONS")
- ;;; (command "text" "16.1087,15.8403" "0.065" "0" "ZONE")
- ;;; (command "text" "16.5801,15.8403" "0.065" "0" "REV")
- ;;; (command "text" "17.8820,15.8403" "0.065" "0" "DESCRIPTION")
- ;;; (command "text" "19.9477,15.8403" "0.065" "0" "DATE")
- ;;; (command "text" "20.7414,15.8403" "0.065" "0" "APPROVED")
- ;;; ;;;
- ;;; (command "text" "mc" "0.25,2.125" "0.25" "0" "A")
- ;;; (command "text" "mc" "0.25,6.375" "0.25" "0" "B")
- ;;; (command "text" "mc" "0.25,10.625" "0.25" "0" "C")
- ;;; (command "text" "mc" "0.25,14.875" "0.25" "0" "D")
- ;;; (command "text" "mc" "21.75,2.125" "0.25" "0" "A")
- ;;; (command "text" "mc" "21.75,6.375" "0.25" "0" "B")
- ;;; (command "text" "mc" "21.75,10.625" "0.25" "0" "C")
- ;;; (command "text" "mc" "21.75,14.875" "0.25" "0" "D")
- ;;; ;;;
- ;;; (command "text" "mc" "19.25,0.5" "0.25" "0" "1")
- ;;; (command "text" "mc" "13.75,0.5" "0.25" "0" "2")
- ;;; (command "text" "mc" "8.25,0.5" "0.25" "0" "3")
- ;;; (command "text" "mc" "2.75,0.5" "0.25" "0" "4")
- ;;; ;;;
- ;;; (command "text" "mc" "19.25,16.5" "0.25" "0" "1")
- ;;; (command "text" "mc" "13.75,16.5" "0.25" "0" "2")
- ;;; (command "text" "mc" "8.25,16.5" "0.25" "0" "3")
- ;;; (command "text" "mc" "2.75,16.5" "0.25" "0" "4")
- ;;; END_ITEM
- ;;;
- ;;; An ANSI - D size sheet with Title block and revision bar.
- ;;; All points are in paperspace units at a scale of 1 inch.
- ;;;
- ;;; NAME - ANSI-D Size
- ;;; (command "zoom" "w" "-0.5,-0.5" "34.5,22.5")
- ;;; (command "line" "0,0" "34,0" "34,22" "0,22" "C")
- ;;; (command "line" "1,.5" "33,.5" "33,21.5" "1,21.5" "C")
- ;;; (command "line" "4.25,.125" "4.25,.5" "")
- ;;; (command "array" (entlast) "" "R" "2" "8" "21.375" "4.25")
- ;;; (command "line" ".5,5.5" "1,5.5" "")
- ;;; (command "array" (entlast) "" "R" "3" "2" "5.5" "32.5")
- ;;; ;;;
- ;;; ;;; Bottom microfilm alignment arrow
- ;;; (command "pline" "17,.1" "w" "0.02" "" "17,.3" "")
- ;;; (command "solid" "16.8,.3" "17.2,.3" "17,.5" "" "")
- ;;; ;;; Right microfilm alignment arrow
- ;;; (command "pline" "33.4,11" "w" "0.02" "" "33.4,11" "")
- ;;; (command "solid" "33.2,10.8" "33.2,11.2" "33,11" "" "")
- ;;; ;;; Top microfilm alignment arrow
- ;;; (command "pline" "17,21.9" "w" "0.02" "" "17,21.7" "")
- ;;; (command "solid" "16.8,21.7" "17.2,21.7" "17,21.5" "" "")
- ;;; ;;; Left microfilm alignment arrow
- ;;; (command "pline" ".6,11" "w" "0.02" "" ".8,11" "")
- ;;; (command "solid" ".8,10.8" ".8,11.2" "1,11" "" "")
- ;;; ;;;
- ;;; ;;;
- ;;; ;;; Title block
- ;;; ;;;
- ;;; (command "line" "25.38,.5" "25.38,3" "33,3" "")
- ;;; (command "line" "27.88,.5" "27.88,3" "")
- ;;; (command "line" "27.88,.75" "33,.75" "")
- ;;; (command "line" "25.38,1.25" "33,1.25" "")
- ;;; (command "line" "27.88,2.37" "33,2.37" "")
- ;;; (command "line" "25.38,.875" "27.88,.875" "")
- ;;; ;;;
- ;;; (command "line" "28.87,.5" "28.87,.75" "")
- ;;; (command "line" "31.25,.5" "31.25,.75" "")
- ;;; (command "line" "28.26,.75" "28.26,1.25" "")
- ;;; (command "line" "29.51,.75" "29.51,1.25" "")
- ;;; (command "line" "32.5,.75" "32.5,1.25" "")
- ;;; ;;;
- ;;; (command "style" "adesk1" "romans" "0" "1.0" "0" "" "" "")
- ;;; (command "text" "27.9323,0.5925" "0.065" "0" "SCALE")
- ;;; (command "text" "31.3028,0.5925" "0.065" "0" "SHEET")
- ;;; (command "text" "27.9679,1.1359" "0.065" "0" "SIZE")
- ;;; (command "text" "28.3289,1.1359" "0.065" "0" "FSCM NO.")
- ;;; (command "text" "29.5810,1.1359" "0.065" "0" "DWG NO.")
- ;;; (command "text" "32.6405,1.1359" "0.065" "0" "REV")
- ;;; ;;;
- ;;; ;;; Revision bar
- ;;; ;;;
- ;;; ;;; Horizontals
- ;;; (command "line" "26,21.25" "33,21.25" "")
- ;;; (command "line" "26,21" "33,21" "")
- ;;; ;;;
- ;;; ;;; Verticals
- ;;; (command "line" "26,20.4527" "26,21.5" "")
- ;;; (command "line" "26.5,21" "26.5,21.25" "")
- ;;; (command "line" "26.88,21" "26.88,21.25" "")
- ;;; (command "line" "31.12,21" "31.12,21.25" "")
- ;;; (command "line" "32,21" "32,21.25" "")
- ;;; ;;;
- ;;; ;;; Revision bar text
- ;;; ;;;
- ;;; (command "text" "29.5746,21.3325" "0.065" "0" "REVISIONS")
- ;;; (command "text" "26.1087,21.0903" "0.065" "0" "ZONE")
- ;;; (command "text" "26.5801,21.0903" "0.065" "0" "REV")
- ;;; (command "text" "28.7464,21.0903" "0.065" "0" "DESCRIPTION")
- ;;; (command "text" "31.4477,21.0903" "0.065" "0" "DATE")
- ;;; (command "text" "32.2477,21.0903" "0.065" "0" "APPROVED")
- ;;; ;;;
- ;;; (command "text" "mc" "0.5,2.75" "0.25" "0" "A")
- ;;; (command "text" "mc" "0.5,8.25" "0.25" "0" "B")
- ;;; (command "text" "mc" "0.5,13.75" "0.25" "0" "C")
- ;;; (command "text" "mc" "0.5,19.25" "0.25" "0" "D")
- ;;; (command "text" "mc" "33.5,2.75" "0.25" "0" "A")
- ;;; (command "text" "mc" "33.5,8.25" "0.25" "0" "B")
- ;;; (command "text" "mc" "33.5,13.75" "0.25" "0" "C")
- ;;; (command "text" "mc" "33.5,19.25" "0.25" "0" "D")
- ;;; ;;;
- ;;; (command "text" "mc" "2.125,0.25" "0.25" "0" "8")
- ;;; (command "text" "mc" "6.375,0.25" "0.25" "0" "7")
- ;;; (command "text" "mc" "10.625,0.25" "0.25" "0" "6")
- ;;; (command "text" "mc" "14.875,0.25" "0.25" "0" "5")
- ;;; (command "text" "mc" "19.125,0.25" "0.25" "0" "4")
- ;;; (command "text" "mc" "23.375,0.25" "0.25" "0" "3")
- ;;; (command "text" "mc" "27.625,0.25" "0.25" "0" "2")
- ;;; (command "text" "mc" "31.875,0.25" "0.25" "0" "1")
- ;;; ;;;
- ;;; (command "text" "mc" "2.125,21.75" "0.25" "0" "8")
- ;;; (command "text" "mc" "6.375,21.75" "0.25" "0" "7")
- ;;; (command "text" "mc" "10.625,21.75" "0.25" "0" "6")
- ;;; (command "text" "mc" "14.875,21.75" "0.25" "0" "5")
- ;;; (command "text" "mc" "19.125,21.75" "0.25" "0" "4")
- ;;; (command "text" "mc" "23.375,21.75" "0.25" "0" "3")
- ;;; (command "text" "mc" "27.625,21.75" "0.25" "0" "2")
- ;;; (command "text" "mc" "31.875,21.75" "0.25" "0" "1")
- ;;; END_ITEM
- ;;;
- ;;; An ANSI - E size sheet with Title block and revision bar.
- ;;; All points are in paperspace units at a scale of 1 inch.
- ;;;
- ;;; NAME - ANSI-E Size
- ;;; (command "zoom" "w" "-0.5,-0.5" "44.5,34.5")
- ;;; (command "line" "0,0" "44,0" "44,34" "0,34" "C")
- ;;; (command "line" ".5,1" "43.5,1" "43.5,33" ".5,33" "C")
- ;;; (command "line" "5.5,.5" "5.5,1" "")
- ;;; (command "array" (entlast) "" "R" "2" "8" "32.5" "5.5")
- ;;; (command "line" ".125,4.25" ".5,4.25" "")
- ;;; (command "array" (entlast) "" "R" "7" "2" "4.25" "43.375")
- ;;; ;;;
- ;;; ;;; Bottom microfilm alignment arrow
- ;;; (command "pline" "22,.6" "w" "0.02" "" "22,.8" "")
- ;;; (command "solid" "21.8,.8" "22.2,.8" "22,1" "" "")
- ;;; ;;; Right microfilm alignment arrow
- ;;; (command "pline" "43.9,17" "w" "0.02" "" "43.7,17" "")
- ;;; (command "solid" "43.7,16.8" "43.7,17.2" "43.5,17" "" "")
- ;;; ;;; Top microfilm alignment arrow
- ;;; (command "pline" "22,33.4" "w" "0.02" "" "22,33.2" "")
- ;;; (command "solid" "21.8,33.2" "22.2,33.2" "22,33" "" "")
- ;;; ;;; Left microfilm alignment arrow
- ;;; (command "pline" ".1,17" "w" "0.02" "" ".3,17" "")
- ;;; (command "solid" ".3,16.8" ".3,17.2" ".5,17" "" "")
- ;;; ;;;
- ;;; ;;;
- ;;; ;;; Title block
- ;;; ;;;
- ;;; (command "line" "35.88,1" "35.88,3.5" "43.5,3.5" "")
- ;;; (command "line" "35.88,1.375" "38.38,1.375" "")
- ;;; (command "line" "35.88,1.75" "43.5,1.75" "")
- ;;; (command "line" "38.38,1.25" "43.5,1.25" "")
- ;;; (command "line" "38.38,2.87" "43.5,2.87" "")
- ;;; ;;;
- ;;; (command "line" "38.38,1" "38.38,3.5" "")
- ;;; (command "line" "39.37,1" "39.37,1.25" "")
- ;;; (command "line" "41.75,1" "41.75,1.25" "")
- ;;; (command "line" "38.76,1.25" "38.76,1.75" "")
- ;;; (command "line" "40.01,1.25" "40.01,1.75" "")
- ;;; (command "line" "43,1.25" "43,1.75" "")
- ;;; ;;;
- ;;; (command "style" "adesk1" "romans" "0" "1.0" "0" "" "" "")
- ;;; (command "text" "38.4323,1.0925" "0.065" "0" "SCALE")
- ;;; (command "text" "41.8028,1.0925" "0.065" "0" "SHEET")
- ;;; (command "text" "38.4679,1.6359" "0.065" "0" "SIZE")
- ;;; (command "text" "38.8289,1.6359" "0.065" "0" "FSCM NO.")
- ;;; (command "text" "40.0810,1.6359" "0.065" "0" "DWG NO.")
- ;;; (command "text" "43.1405,1.6359" "0.065" "0" "REV")
- ;;; ;;;
- ;;; ;;; Revision bar
- ;;; ;;;
- ;;; ;;; Horizontals
- ;;; (command "line" "36.5,32.75" "43.5,32.75" "")
- ;;; (command "line" "36.5,32.5" "43.5,32.5" "")
- ;;; ;;;
- ;;; ;;; Verticals
- ;;; (command "line" "36.5,31.9527" "36.5,33" "")
- ;;; (command "line" "37,32.5" "37,32.75" "")
- ;;; (command "line" "37.38,32.5" "37.38,32.75" "")
- ;;; (command "line" "41.62,32.5" "41.62,32.75" "")
- ;;; (command "line" "42.5,32.5" "42.5,32.75" "")
- ;;; ;;;
- ;;; ;;; Revision bar text
- ;;; ;;;
- ;;; (command "text" "40.0746,32.8325" "0.065" "0" "REVISIONS")
- ;;; (command "text" "36.6087,32.5903" "0.065" "0" "ZONE")
- ;;; (command "text" "37.0801,32.5903" "0.065" "0" "REV")
- ;;; (command "text" "39.2464,32.5903" "0.065" "0" "DESCRIPTION")
- ;;; (command "text" "41.9477,32.5903" "0.065" "0" "DATE")
- ;;; (command "text" "42.7477,32.5903" "0.065" "0" "APPROVED")
- ;;; ;;;
- ;;; (command "text" "mc" "0.25,2.125" "0.25" "0" "A")
- ;;; (command "text" "mc" "0.25,6.375" "0.25" "0" "B")
- ;;; (command "text" "mc" "0.25,10.625" "0.25" "0" "C")
- ;;; (command "text" "mc" "0.25,14.875" "0.25" "0" "D")
- ;;; (command "text" "mc" "0.25,19.125" "0.25" "0" "E")
- ;;; (command "text" "mc" "0.25,23.375" "0.25" "0" "F")
- ;;; (command "text" "mc" "0.25,27.625" "0.25" "0" "G")
- ;;; (command "text" "mc" "0.25,31.875" "0.25" "0" "H")
- ;;; ;;;
- ;;; (command "text" "mc" "43.75,2.125" "0.25" "0" "A")
- ;;; (command "text" "mc" "43.75,6.375" "0.25" "0" "B")
- ;;; (command "text" "mc" "43.75,10.625" "0.25" "0" "C")
- ;;; (command "text" "mc" "43.75,14.875" "0.25" "0" "D")
- ;;; (command "text" "mc" "43.75,19.125" "0.25" "0" "E")
- ;;; (command "text" "mc" "43.75,23.375" "0.25" "0" "F")
- ;;; (command "text" "mc" "43.75,27.625" "0.25" "0" "G")
- ;;; (command "text" "mc" "43.75,31.875" "0.25" "0" "H")
- ;;; ;;;
- ;;; (command "text" "mc" "2.75,0.5" "0.25" "0" "8")
- ;;; (command "text" "mc" "8.25,0.5" "0.25" "0" "7")
- ;;; (command "text" "mc" "13.75,0.5" "0.25" "0" "6")
- ;;; (command "text" "mc" "19.25,0.5" "0.25" "0" "5")
- ;;; (command "text" "mc" "24.75,0.5" "0.25" "0" "4")
- ;;; (command "text" "mc" "30.25,0.5" "0.25" "0" "3")
- ;;; (command "text" "mc" "35.75,0.5" "0.25" "0" "2")
- ;;; (command "text" "mc" "41.25,0.5" "0.25" "0" "1")
- ;;; ;;;
- ;;; (command "text" "mc" "2.75,33.5" "0.25" "0" "8")
- ;;; (command "text" "mc" "8.25,33.5" "0.25" "0" "7")
- ;;; (command "text" "mc" "13.75,33.5" "0.25" "0" "6")
- ;;; (command "text" "mc" "19.25,33.5" "0.25" "0" "5")
- ;;; (command "text" "mc" "24.75,33.5" "0.25" "0" "4")
- ;;; (command "text" "mc" "30.25,33.5" "0.25" "0" "3")
- ;;; (command "text" "mc" "35.75,33.5" "0.25" "0" "2")
- ;;; (command "text" "mc" "41.25,33.5" "0.25" "0" "1")
- ;;; END_ITEM
- ;;;
- ;;; A sample Architectural 24 x 36 sheet with Title block and revision bar.
- ;;; All points are in paperspace units at a scale of 1 inch.
- ;;;
- ;;; NAME - Arch/Engineering (24 x 36)
- ;;; (command "zoom" "w" "-0.5,-0.5" "36.5,24.5")
- ;;; (command "line" "0,0" "36,0" "36,24" "0,24" "C")
- ;;; ;;; Outer border line
- ;;; (command "pline" ".5,.5" "w" "0.1" "" "35.5,.5" "35.5,23.5" ".5,23.5" "C")
- ;;; (command "fillet" "r" "1")
- ;;; (command "fillet" "p" "l")
- ;;; ;;;
- ;;; ;;; Title block
- ;;; ;;;
- ;;; ;;; Outer border line
- ;;; (command "pline" "31,1" "w" "0.05" "" "35,1" "35,23" "31,23" "C")
- ;;; (command "fillet" "r" ".5")
- ;;; (command "fillet" "p" "l")
- ;;; ;;;
- ;;; ;;; Sheet No. border line
- ;;; (command "pline" "31.25,1.25" "34.75,1.25" "34.75,2.75" "31.25,2.75" "C")
- ;;; (command "fillet" "r" ".25")
- ;;; (command "fillet" "p" "l")
- ;;; ;;;
- ;;; ;;; Project border line
- ;;; (command "pline" "31.25,3" "34.75,3" "34.75,5" "31.25,5" "C")
- ;;; (command "fillet" "p" "l")
- ;;; ;;;
- ;;; ;;; Firm border line
- ;;; (command "pline" "31.25,5.25" "34.75,5.25" "34.75,7.25" "31.25,7.25" "C")
- ;;; (command "fillet" "p" "l")
- ;;; ;;;
- ;;; ;;; Notes/Revisions border line
- ;;; (command "pline" "31.25,7.5" "34.75,7.5" "34.75,22.75" "31.25,22.75" "C")
- ;;; (command "fillet" "p" "l")
- ;;; ;;;
- ;;; ;;; Sheet No. lines
- ;;; (command "pline" "33.25,1.25" "w" "0.025" "" "33.25,2.75" "")
- ;;; (command "pline" "31.25,2.25" "33.25,2.25" "")
- ;;; (command "pline" "31.25,1.75" "33.25,1.75" "")
- ;;; ;;;
- ;;; ;;; Notes/Revisions lines
- ;;; (command "pline" "31.75,7.5" "31.75,8.625" "")
- ;;; (command "pline" "34.125,7.5" "34.125,8.625" "")
- ;;; (command "pline" "31.25,7.875" "34.75,7.875" "")
- ;;; (command "pline" "31.25,8.25" "34.75,8.25" "")
- ;;; (command "pline" "31.25,8.625" "34.75,8.625" "")
- ;;; ;;;
- ;;; (command "pline" "31.25,22.375" "34.75,22.375" "")
- ;;; ;;;
- ;;; ;;; Sheet text
- ;;; (command "style" "adesk1" "romans" "0" "1.0" "0" "" "" "")
- ;;; (command "text" "31.4054,7.0711" "0.065" "0" "Firm Name and Address")
- ;;; (command "text" "31.4054,4.8211" "0.065" "0" "Project Name and Address")
- ;;; (command "text" "31.4054,2.5846" "0.065" "0" "Project")
- ;;; (command "text" "33.3899,2.5846" "0.065" "0" "Sheet")
- ;;; (command "text" "31.4054,2.0989" "0.065" "0" "Date")
- ;;; (command "text" "31.4054,1.6132" "0.065" "0" "Scale")
- ;;; ;;;
- ;;; ;;; Revision bar text
- ;;; ;;;
- ;;; (command "text" "mc" "32.9983,22.5578" "0.1" "0" "General Notes")
- ;;; (command "text" "mc" "31.5136,7.7034" "0.1" "0" "No.")
- ;;; (command "text" "mc" "32.9983,7.7034" "0.1" "0" "Revision/Issue")
- ;;; (command "text" "mc" "34.4338,7.7034" "0.1" "0" "Date")
- ;;; ;;;
- ;;; END_ITEM
- ;;; END_DATA
- ;;;
- ;;; MVIEWS
- ;;; None, 0, 0
- ;;; Single, 1, 1, PLAN
- ;;; Std. Engineering, 2, 2, FRONT, PLAN, RIGHT, ISO
- ;;; Array of Viewports
- ;;; END_MVIEWS
- ;;;
- ;;; VPSETNAME - Single
- ;;; (command "mview" ll_crn ur_crn)
- ;;; END_ITEM
- ;;; VPSETNAME - Std. Engineering
- ;;; END_ITEM
- ;;; VPSETNAME - Array of Viewports
- ;;; END_ITEM
- ;;;
- ;;; END_DATA
- ;;;
-