Jump to content
YannickMeuleman

Making autopublish drawing specific

Recommended Posts

YannickMeuleman

Good day CAD-tutors

 

I work at a company wich manages several buildings (aprox 60 buildings)

I manage all the floorplans for the buildings and make sure these stay up to date.

 

Besides the DWG files, I need to keep PDF files ready for co workers to open and see the most up to date version of the buildings.

At the moment, each time I make a change, i need to remember to plot a specific layout to a specific place on our fileserver.

This sometimes gets forgotten and I want to automate the proces.

 

Is it in any way possible to make Lisps drawing specific.

 

I have tried to setup an autopublish, but there are two problems with it. 

   -  I want only one of my layouts to be plotted (I can only select to autopublish all the layouts)

   -  Is there a way to automatically let my plot to be saved to a set location per drawing. Location to be different for each drawing. ( At the moment I can only set one location for all the drawings to be put.)

 

Thanks in advance

 

Yannick

 

Share this post


Link to post
Share on other sites
f700es

Hello Yannick, I do a very similar job. We are CONSTANTLY updating our building plans. So I am in the same boat. So far we just have to make sure that we publish PDFs after an update is made. 

Share this post


Link to post
Share on other sites
maratovich

You need :
Once get all the data for printing and settings from the drawing file.
Save a list of settings and print parameters in a separate settings file.
At any time, open this separate configuration file. Automatically for this settings file to print in pdf.
So you can make a lot of configuration files.
Right ?
This can be solved.

Share this post


Link to post
Share on other sites
BIGAL

Like Maratovich you can program where a pdf is saved, in our case its always a directory PDF under the dwg location, but every project has its own project number directory. \2019 projects\2019123\design\pdf.

 

Are all your pdf's in one spot or like what I described ?

 

Have a look here for plotA3pdfrange2.lsp by me and the excellent plot routine by Maratovich to see if it meets your needs. 

 

Share this post


Link to post
Share on other sites
YannickMeuleman

The PDF of each drawing sits in a different file of the file directory. I will give an example:

 

Building X/plans DWG/Building X_level 1.DWG   --> Location of the DWG file

Building X/plans PDF/Building X_level 1.PDF      --> Location of the PDF file

 

and so we have a lot of different buildings with different amount of levels.

So the buildup is the same, but the path where it is saved is different for each building.

 

I will look into your Lisp to see iff I can work with it, I am still a fair beginner at Lisp. But learning fast to solve my 'fix'.

 

Again thanks in advance for all your replys

Share this post


Link to post
Share on other sites
maratovich

Give us an example of your dwg file.
We need to know how your title block is created.

Share this post


Link to post
Share on other sites
YannickMeuleman

So this is one of our more simple buildings, but i can be used to explain what i want to do.

 

Basically, I want to autopublish the layout called 'basis' every time the drawing gets saved.

Autopublish only gives me the option to publish all the layouts.

Each drawing will have its PDF published to a different file location.

D.A.100_Gelijkvloers.dwg

Share this post


Link to post
Share on other sites
maratovich

Save to another folder?
Maybe next to the file (in the same folder)?

Share this post


Link to post
Share on other sites
BIGAL

My lisp plots a range of layout tabs using the order so you plot say from 1-10 etc the layout name is irrelevant. It is easy to change it to look for a layout name and plot just that one. Same with the directory location it currently makes a directory under the drawing but it can be changed to be higher up. 

 

This is hard coded to suit your dwg and expects the sheet to always have 0,0 at lower right. (I have a fix for that sperately)

 


;Plots layout by name and saves dwg
; By Alan H Feb 2014, updated for one layout only with defualt layout name set.
; Pdf directory is at same level as dwg directory

(defun AH:pltlays ( / val1 dwgname lendwg pdfname layname dwgpre)
(SETVAR "PDMODE" 0)
(setvar "plottransparencyoverride" 2)
(setvar "fillmode" 1)
(setvar "textfill" 1)

; check that pdf directory exists 
; get dwg prefix ie where dwg exists
(setq dwgpre (getvar "dwgprefix") )
(setq lendwg (strlen dwgpre))
(setq dwgpre (strcat (substr dwgpre 1 (- lendwg 4)) "pdf")) ; add pdf to the tail 

(setq dwgname (GETVAR "dwgname"))
(setq lendwg (strlen dwgname))
(setq dwgname (substr dwgname 1 (- lendwg 4))) ; remove the dwg from name

(if (= (vl-file-directory-p dwgpre) nil) ; does pdf exist if not make it
  (vl-mkdir dwgpre)
)

(if (not AH:getval1) (load "getvals3")) ; check if getvals is loaded
(ah:getval1 "Enter Layout name" 20 18 "Basis" ) ; 20 characters
(setq layname val1) ; value from DCL

(SETQ LAYOUTS (vla-get-Layouts (vla-get-activedocument (vlax-get-acad-object))))

(vlax-for lay LAYOUTS
  (if (= layname (vla-get-name lay))
    (setvar "ctab" layname)
  )
(setq pdfname (strcat dwgpre "\\" dwgname "-" (getvar "ctab") ".pdf" ))
)

(setvar "textfill" 1)
(setvar "fillmode" 1)
(setvar "PLOTTRANSPARENCYOVERRIDE" 2)

; change ctb name size should be ok
(COMMAND "-PLOT"  "Y"  "" "dwg to Pdf"
           "Iso full bleed A3 (420.00 x 297.00 MM)" "m" "LANDSCAPE"  "N"   "W"  "-42,-0" "0,29.7" "1=0.1"  "C"
           "y" "Designlaser_temp.ctb" "Y"    "n" "n" "n" pdfName "N" "y"
)
(setvar "filedia" 1)
(command  "save" dwgname "Y")
(setvar "filedia" 0)


) ; defun

(AH:pltlays)
(princ)

Share this post


Link to post
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
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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...