Jump to content

layouts 2 dwg by range


pmxcad

Recommended Posts

Hello,

 

Is there a way of combine these 2 lisps? (attachments)

 

I am looking for a lisp that exports layouts to dwg`s by range. I like the lisp "LayoutsToDwgs.lsp" but i am want to select (by range) the layouts to be exported like the lisp "PLOT BY RANGE CTAB.LSP"

 

Is it also possible to change prefix option in the "LayoutsToDwgs.lsp" to Suffix?

 

Thanks,

 

PmxCAD

LayoutsToDwgs.lsp

PLOT BY RANGE CTAB.LSP

Link to comment
Share on other sites

Pretty sure the (layoutlist) function needs replacing by the method I used in the plot by range original code by me Yeah I am Alan H, I am a bit short of time at moment have a couple of posts to catch up on. Just need to work out the Wblock bit.

 

replace the plot bit in plot range.lsp not tested !

(COMMAND "-PLOT" "Y" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" name "" "" )

with this but you need to supply a file name maybe

(setq fname (strcat (getvar "DWGPREFIX") (getvar "dwgname") (vla-get-name lay)))
(command "_.-wblock" fname "*") ; for civ 3d you may want a "N" to not include map info.

Link to comment
Share on other sites

Sorry Alain, it`s not working. Gives an error: error: bad argument type: VLA-OBJECT nil

 

This is the lisp so far?

 

;
;Plots layouts by range
; By Alan H Feb 2014
;
;
(defun AH:pltlays ( / lay numlay numend)

(setq numlay (getint "\nEnter Start tab number"))
(setq numend (getint "\nEnter last tab number"))

(setq len (+ (- numend numlay) 1))

(repeat len
(vlax-for lay (vla-get-Layouts (vla-get-activedocument (vlax-get-acad-object)))
(if (= numlay (vla-get-taborder lay))
 (setvar "ctab" (vla-get-name lay))
) ; if
(princ (getvar "ctab"))
) ; for
(setq lay nil)
;
;
;
;
;
(setq fname (strcat (getvar "DWGPREFIX") (getvar "dwgname") (vla-get-name lay)))
(command "_.-wblock" fname "*") ; for civ 3d you may want a "N" to not include map info.

(setq numlay (+ numlay 1))
) ; end repeat
) ; defun

(AH:pltlays)

 

 

 

 

Thanks,

PmxCAD

Link to comment
Share on other sites

Try this

 

;
;Plots layouts by range
; By Alan H Feb 2014
;
;
(defun AH:pltlays ( / lay numlay numend)
(setq numlay (getint "\nEnter Start tab number"))
(setq numend (getint "\nEnter last tab number"))
(setq len (+ (- numend numlay) 1))
(repeat len
(vlax-for lay (vla-get-Layouts (vla-get-activedocument (vlax-get-acad-object)))
(setq fname (strcat (getvar "DWGPREFIX") (getvar "dwgname") (vla-get-name lay)))
(if (= numlay (vla-get-taborder lay))
 (setvar "ctab" (vla-get-name lay))
) ; if
(princ (getvar "ctab"))
) ; for
(setq lay nil)
(command "pspace")
(command "_.-wblock" fname "*" ) ; for civ 3d you may want a "N" to not include map info.
(setq numlay (+ numlay 1))
) ; end repeat
) ; defun
(AH:pltlays)

Link to comment
Share on other sites

Nope, sorry Alan.

There is no suffix or prefix so it overwrite it selfs. The drawing what has been created has a strange file name en still contains al layouts. I prefer to choose a suffix to the file name.

This has been created: 1640BOSR6UED-ELH19000001.dwgR6UED MMX.dwg. 1640BOSR6UED-ELH19000001.dwg is the file name en R6UED MMX is a layout name.

 

PmxCAD

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...