+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Senior Member
    Using
    AutoCAD 2010
    Join Date
    Apr 2011
    Posts
    145

    Default Lisp to set plot up

    Registered forum members do not see this ad.

    Hi Guys I came across the following routine, from https://forums.autodesk.com/t5/forum...e/false/page/2

    However, when I tried it it gives me an error message ; error: no function definition: LM:ODBX

    How can I get this to work and also change the default size to A1 rather than A2.

    Code:
    (defun c:RV ( / )
        (LM:ODBX
            (function
                (lambda ( doc )
    		(princ (strcat "\nOpening file : "(vla-get-name doc)))
    		(vlax-for lay (vla-get-layouts doc)
    
    			; (if ( = "Model" (vla-get-name lay))
    				; (progn
    				(setq PaperSize "ISO_A2_(594.00_x_420.00_MM)");-----default paper size
    				
    				(princ "\nSearching for Title Block")
    				(vlax-for blk (vla-get-blocks doc)
    				(cond
    					(( = (vla-get-name blk) "Title_A4") (setq PaperSize "ISO_A4_(297.00_x_210.00_MM)"))
    					(( = (vla-get-name blk) "A3 Drawing Sheet") (setq PaperSize "ISO_A3_(420.00_x_297.00_MM)"))
    					(( = (vla-get-name blk) "Title_A2") (setq PaperSize "ISO_A2_(594.00_x_420.00_MM)"))
    					(( = (vla-get-name blk) "Title_A1") (setq PaperSize "ISO_A1_(841.00_x_594.00_MM)"))
    				);cond
    				);vlax-for blocks
    				(princ (strcat "\nPaper Size Assigned : " PaperSize))
    				; );progn
    			; );if model space
    
    
    			(vla-put-ConfigName lay "DWG To PDF.pc3")	;set the plotter
    			(vla-put-CanonicalMediaName lay PaperSize)		;set the paper size--->
    			(vla-put-PlotType lay "1")			;plot area extens
    			(vla-put-CenterPlot lay "1")			;center plot
    			(vla-put-PaperUnits lay "1")			;set units to mm
    			(vla-put-PlotWithLineweights lay "0")		;turn off lineweights
    			(vla-put-PlotWithPlotStyles lay "1")		;turn on plot styles
    			(vla-put-StandardScale lay "0")			;fit to paper
    			(vla-put-stylesheet lay "Grayscale.ctb")	;set  the CTB
    			(princ (strcat "\nPlot settings done for : "(vla-get-name lay)))
    		);vlax-for
    		(princ "\n--------------------------------------------------")
                )
            )
            nil t
        )
        (princ)
    );defun

  2. #2
    Quantum Mechanic ReMark's Avatar
    Computer Details
    ReMark's Computer Details
    Operating System:
    Windows 7 Pro 64-bit
    Computer:
    Thinkmate
    Motherboard:
    Intel DX58SO2 LGA1366 X58
    CPU:
    Intel i7-960 Quad-core 3.20GHz 8MB cache
    RAM:
    12GB (3x4GB) PC3-106000 DDR3
    Graphics:
    nVidia Quadro K4200, 4GB GDDR5
    Primary Storage:
    150GB Velocipraptor 10,000 rpm
    Secondary Storage:
    none
    Monitor:
    Dell P24LLH - 24" wide screen LCD
    Discipline
    See details...
    ReMark's Discipline Details
    Occupation
    CAD Draftsman/Designer...chemical manufacturing.
    Discipline
    See details below.
    Details
    I work for a specialty chemical manufacturer. I do a little bit of everything from P&IDs to civil to architectural and structural.
    Using
    AutoCAD 2018
    Join Date
    Nov 2005
    Location
    Norwalk, CT USofA
    Posts
    46,506

    Default

    Re: change default paper size. Wouldn't you just substitute "ISO_A1_(841.00_x_594.00_MM)") for "ISO_A2_(594.00_x_420.00_MM)") where it says (setq PaperSize...default paper size? Can't help you with the first question. Sorry.
    "I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police

    Eat brains...gain more knowledge!

    I'm now a full member of the Society for the Promotion of Mediocrity in CAD. Standards? We don't need no stinkin' standards! Take whatever advice I offer and do the opposite.

  3. #3
    Super Member
    Using
    Civil 3D 2015
    Join Date
    Aug 2015
    Posts
    508

    Default

    In general, if you see a function that starts with LM: it will have been created by Lee Mac because that is his signature he puts on nearly all functions (you can also bet that it will be an awesome function because he is the master of all things LISP haha). That function can be found on his website http://www.lee-mac.com/odbxbase.html.

  4. #4
    Senior Member
    Using
    AutoCAD 2010
    Join Date
    Apr 2011
    Posts
    145

    Default

    Thanks Broncos15 will have a look into Lee's site

  5. #5
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    19,368

    Default

    Quote Originally Posted by broncos15 View Post
    In general, if you see a function that starts with LM: it will have been created by Lee Mac because that is his signature he puts on nearly all functions (you can also bet that it will be an awesome function because he is the master of all things LISP haha).
    Haha! Thanks broncos
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

  6. #6
    Senior Member
    Using
    AutoCAD 2010
    Join Date
    Apr 2011
    Posts
    145

    Default

    Hi Lee,

    Any ideas why that lamda function is not functioning as it should?

  7. #7
    Luminous Being
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    9,901

    Default

    Registered forum members do not see this ad.

    My $0.05 went a slightly different way just have a pull down menu with the various plot sizes and destination printer hard coded rather than select. Pick option 20 sheets come out etc.
    Attached Images
    A man who never made mistakes never made anything

Similar Threads

  1. Batch plot Lisp?
    By CadTechJGC184 in forum AutoLISP, Visual LISP & DCL
    Replies: 20
    Last Post: 4th Dec 2013, 05:17 pm
  2. Plot all layouts using custom plot lisp
    By woodman78 in forum AutoLISP, Visual LISP & DCL
    Replies: 10
    Last Post: 24th Apr 2012, 01:20 pm
  3. Help with PDF plot lisp
    By nlao in forum AutoLISP, Visual LISP & DCL
    Replies: 0
    Last Post: 15th Jun 2011, 12:43 pm
  4. Plot current layout without entering name is lisp plot string
    By hosannabizarre in forum AutoLISP, Visual LISP & DCL
    Replies: 4
    Last Post: 8th Apr 2011, 01:43 pm
  5. lisp plot?
    By lewis770227 in forum AutoLISP, Visual LISP & DCL
    Replies: 4
    Last Post: 24th Mar 2009, 09:57 pm

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts