Results 1 to 4 of 4

Thread: How to use custom DWGPROPS inside a LISP

  1. #1
    Member
    Join Date
    2018-08
    Posts
    4
    Login to Give a bone
    0

    Default How to use custom DWGPROPS inside a LISP

    Hi,

    This is my first post here, but I've been using AUGI Forums for a while now. I've been lucky enough to find most if not all of the information I needed until now.

    I'm at a very beginner level with writing LISPs, but is it possible to use a custom dwgprops field inside a LISP?

    I'm writing a simple LISP that saves the individual sheet with a specific file name (eventually I want to set a location as well). I want the file name to be derived from the dwg file name, tab name, and a custom dwgprops I added.

    i.e.
    DWGNAME = car
    TAB NAME = 11x17
    Custom dwgprops (MonthYear) = August 2018
    =
    car_11x17_August 2018

    I got as far as the tab name, but I am stuck with trying to get the custom dwgprops into the file name. Any help is greatly appreciated. Thank you!




    Code:
    (defun c:EP (/ savename)
    	(setq savename (strcat (vl-filename-base (getvar "dwgname")) (getvar "ctab") (setq dProps (vlax-getProperty acadDocument 'MonthYear))))
    	(command "-export" "p" "c" "n" savename)
    (princ)
    )
    Last edited by Opie; 2018-08-15 at 02:59 PM. Reason: [code] tags added ~Opie

  2. #2
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,100
    Login to Give a bone
    0

    Default Re: How to use custom DWGPROPS inside a LISP

    Have a look at this post to see if there is anything there that may help you.

    Also, when posting code you can place your code in a code block by surrounding your code with the [code]... your code here...[/code] tags.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  3. #3
    Member
    Join Date
    2018-08
    Posts
    4
    Login to Give a bone
    0

    Default Re: How to use custom DWGPROPS inside a LISP

    Thank you! I didn't quite fully understand what was going on that code, but I got somehow got some info from it and got my code to work. If you want to take a look, it's down below.

    I know this is a separate topic, but do you happen to know if there is a way to add to this LISP so that it PDFs out all the sheets as individual files with one command, with their own separate names (only difference would be the ctab name)?
    i.e. dwgfilename_11x17_date
    dwgfilename_24x36_date
    (the paper size would be on the tab title, which is derived from "ctab")

    Code:
    (defun c:EP (/ dmy newpath underscore savename)
    	(setvar "filedia" 0)
    
        (setq acadObj (vlax-get-acad-object))
        (setq doc (vla-get-ActiveDocument acadObj))
        (setq summaryInfo (vla-get-SummaryInfo doc))
    
        (vla-GetCustomByIndex summaryInfo 0 'Key0 'Value0)
    	(setq dmy Value0)
    	(setq newpath "c:/work/")
    	(setq underscore "_")
    	(setq savename 
    		(strcat newpath
    			(vl-filename-base
    				(getvar "dwgname")
    			)
    			underscore
    			(getvar "ctab") underscore dmy
    		)
    	)
    	(command "-export"
    		"p"
    		"c"
    		"n"
    		savename)
    	(setvar "filedia" 1)
    (princ)
    )

  4. #4
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,100
    Login to Give a bone
    0

    Default Re: How to use custom DWGPROPS inside a LISP

    Check this app from BlackBox for the AutoPublish.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

Similar Threads

  1. lisp to trim the line inside multiple blocks
    By ossa.omar675029 in forum AutoLISP
    Replies: 7
    Last Post: 2014-07-15, 06:07 PM
  2. Run dll file inside LISP
    By mtubbs in forum AutoLISP
    Replies: 4
    Last Post: 2010-03-18, 05:31 AM
  3. Run a LISP routine from inside another
    By mpemberton in forum AutoLISP
    Replies: 5
    Last Post: 2006-06-26, 07:12 PM
  4. Replies: 5
    Last Post: 2006-03-02, 12:15 PM

Tags for this Thread

Posting Permissions

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