Page 4 of 6 FirstFirst 123456 LastLast
Results 31 to 40 of 60

Thread: LSP & DCL Change Font/Colors & Add Image?

  1. #31
    I could stop if I wanted to ameador's Avatar
    Join Date
    2006-02
    Posts
    414

    Default Re: LSP & DCL Change Font/Colors & Add Image?

    Quote Originally Posted by rkmcswain View Post
    If a drawing is already open as 'read-only', it's too late to ask the user if he wants to cancel or open... ? Did I misunderstand...?
    Ah, sorry about the wording there....I'll try to clarify....
    First I would like to be able to check to see if the user opened a non-07 dwg as read-only or not.
    If they did not open the non-07 as read-only, then I would like to use the dialog box we've got going here and add a button to it that would basically convert the dwg to a read-only version instead. (which would mean closing the dwg and re-opening it as read-only). But I'm not sure if this is possible.

    The other concept that was in there was how can I nest another pop-up when they hit the "open" button to ask them if they are really sure "yes" or "no" sort of thing.

    Did that make more sense?
    CAD user since '95, CAD Mgr since '07, Mech Eng
    R10, R14, 2000i, 2002, 2004, ABS 2007, AMEP 2009, 2011 & 2012, RMEP 2011 & 2012
    Author of: http://ab-nerd-disc.blogspot.com/

  2. #32
    I could stop if I wanted to
    Join Date
    2006-07
    Posts
    233

    Default Re: LSP & DCL Change Font/Colors & Add Image?

    You will need to setup a new dcl and lisp with a new name and then in the action_tile for the open button you will need to have it call the lisp program and in the new lisp program is where you will call the dialogue.

  3. #33
    Certified AUGI Addict rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Houston
    Posts
    7,519

    Default Re: LSP & DCL Change Font/Colors & Add Image?

    Yea, nesting is a little tricky. There is a pretty good example in the help files. Just be warned that experimenting with DCL can lock AutoCAD up real fast... don't mess around if you have production work loaded...

    As far as the read-only thing, if the file has not been loaded yet, you can use DOSLIB or another method to change the read-only file attribute just before opening the file if this method is sufficient for you...

  4. #34
    I could stop if I wanted to
    Join Date
    2006-07
    Posts
    233

    Default Re: LSP & DCL Change Font/Colors & Add Image?

    I started looking around at this read-only stuff and found this taht you could use.
    Code:
    (vl-cmdf "vbastmt" "acadapplication.documents.open \"C:\\Cad\\cad.dwg\",TRUE")
    And you could set the file path name to a variable in put in place of the file path name in the code above. So when ever you press the read only button on your dialogue it runs the code.

    Example Code
    Code:
    (setq DwgName (strcat (vla-get-path(vla-get-activedocument(vlax-get-acad-object))) "\\" (vla-get-name(vla-get-activedocument(vlax-get-acad-object)))))
    (vl-cmdf "vbastmt" (strcat "acadapplication.documents.open\"" DwgName,"\"TRUE"))
    Last edited by Lions60; 2008-09-26 at 06:30 PM.

  5. #35
    I could stop if I wanted to ameador's Avatar
    Join Date
    2006-02
    Posts
    414

    Default Re: LSP & DCL Change Font/Colors & Add Image?

    See this is why AUGI rocks...b/c of people like ya'll!

    Fortunately for me I'm at a point where I don't have to work on production dwgs at the moment. I always make sure I'm working/testing off of my harddrive not the network production dwgs.

    I'll have to check out those lines of code and the help files.

    The thing is...with what we have set up right now, the dwg loads entirely comes up to the command prompt and then you see the pop-up. So somehow I think we have to close the dwg and then open it back up as a read-only.

    One of my guys found this little line of code, but we're not sure how to manipulate it. It seems to loop b/c it can't tell if the file really is read only or not.

    Code:
    (vla-activate (vla-open (vla-get-documents (vlax-get-acad-object)) dwgfile :VLAX-TRUE))
    CAD user since '95, CAD Mgr since '07, Mech Eng
    R10, R14, 2000i, 2002, 2004, ABS 2007, AMEP 2009, 2011 & 2012, RMEP 2011 & 2012
    Author of: http://ab-nerd-disc.blogspot.com/

  6. #36
    I could stop if I wanted to
    Join Date
    2006-07
    Posts
    233

    Default Re: LSP & DCL Change Font/Colors & Add Image?

    Here is some code that will automatically open the drawing as read only once you hit your open button. The only bad thing is you kind of get into a continuous loop with your dialogue box as soon as it opens up the read-only drawing you are prompted to either cancel or open again with the dialog box. The original drawing is also still open at this time as i'm not sure how to get it to close. There were no changes to the dcl.

    Code:
    ;;;;
    ;;;;Beginning of the AutoLISP routine
    ;;;
      (setq mykey "sld")
    (setq myslidename "C:\\Documents and Settings\\laoom\\Desktop\\warnimage test04.sld")
      (setq dwgfile (strcat (getvar "dwgprefix")(getvar "dwgname")))
      (setq rfile (open dwgfile "r"))
      (setq dwgver (substr (read-line rfile) 1 6))
      (close rfile)
    
      (cond
        
        ((= dwgver "AC1021")
         (close)
         )
        ((= dwgver "AC1014")
         (setq acadv "AutoCAD R14")
         )
        ((= dwgver "AC1012")
         (setq acadv "AutoCAD R13")
         )
        ((= dwgver "AC1009")
         (setq acadv "AutoCAD R11 or R12")
         )
        ((= dwgver "AC1006")
         (setq acadv "AutoCAD R10")
         )
        ((= dwgver "AC1004")
         (setq acadv "AutoCAD R9")
         )
        ((= dwgver "AC1002")
         (setq acadv "AutoCAD R2.6")
         )
        ((= dwgver "AC1.50")
         (setq acadv "AutoCAD R2.05")
        )
        ((= dwgver "AC1015")
         (setq acadv "AutoCAD 2000")
        )
        ((= dwgver "AC1016")
         (setq acadv "AutoCAD 2000i")
        )
        ((= dwgver "AC1017")
         (setq acadv "AutoCAD 2002")
        )
        ((= dwgver "AC1018")
         (setq acadv "AutoCAD 2004")
        )
        ((= dwgver "AC1019")
         (setq acadv "AutoCAD 2005")
        )
        ((= dwgver "AC1020")
         (setq acadv "AutoCAD 2006")
        )
    ;;;;    ((= dwgver "AC1022")
    ;;;;     (setq acadv "AutoCAD 2008")
    ;;;;    )
    ;;;;    ((= dwgver "AC1023")
    ;;;;     (setq acadv "AutoCAD 2009")
    ;;;;    )
    
      )
    
    
    (setq dclid (load_dialog "warnr14.dcl"))
    (new_dialog "warnr14" dclid)
    (defun edit_action1 (val)
    (setq NT val)
    )
    
      ;;;--- Get the width of the slide
      (setq width (dimx_tile mykey))
    
      ;;;--- Get the height of the slide 
      (setq height (dimy_tile mykey))
    
      ;;;--- Start the slide definition
      (start_image mykey)
    
      ;;;--- Wipe out the background
      (fill_image 0 0 width height -15)
    
      ;;;--- Put the slide in the image area
      (slide_image 0 0 width height myslidename)
    
      ;;;--- Finish the slide definition
      (end_image)
    
    (action_tile "accept" "(setq DwgName (strcat (vla-get-path(vla-get-activedocument(vlax-get-acad-object))) \"/\" (vla-get-name(vla-get-activedocument(vlax-get-acad-object)))))
    (done_dialog 1)")
    (action_tile "cancel" "(done_dialog)")
    
    ;(set_tile "mytile" (getvar "dwgname"))
    ;(set_tile "mytile" acadv)
    (set_tile "mytile" (strcat "YOU JUST OPENED AN  " acadv "  DWG IN 2007."))
    
    (setq ans(start_dialog))
    
    (unload_dialog dclid)
    (if (= ans 1)
    (vl-cmdf "vbastmt" (strcat "acadapplication.documents.open\"" DwgName"\",TRUE"))
    (progn
    
    (done_dialog)
    (command "_.close" "Y")
    ))
    
    ;;;;
    ;;;;End of the AutoLISP routine

  7. #37
    I could stop if I wanted to ameador's Avatar
    Join Date
    2006-02
    Posts
    414

    Default Re: LSP & DCL Change Font/Colors & Add Image?

    Hmm...I've added a "readonly button" to it.
    So now if you hit the read only button it will open the read only file, but as you stated it will open the dialog box up again to ask for cancel/readonly/open.
    If you hit open it keeps both the original dwg open and the readonly copy open.
    If you hit cancel it cancels the readonly copy, but keeps the orginal one open.
    If you hit read only again, it goes into the dialog box again after it opens another read only copy.

    Here's my modified version:
    LSP file:
    Code:
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;
    ;;  This program is designed to be used with the warnr14.dcl file.
    ;;  They are to be stored locally on the users' machine under the product's support file area. 
    ;;	I.E.: C:Program Files_Autodesk Building Systems 2007_Support
    ;;  This program uses the slide image "WarnImage.sld" that is stored here: F:HBEDT2K7_Setup
    ;;  It was created to pop-up a warning when a dwg of a lower version is opened in a 2007 product.
    ;;  The user will get a choice to cancel out of the open, or go ahead with the open.
    ;;  Currently this pop-up will appear if the file is opened full out or read-only.
    ;;  It will not affect any dwgs that are already open in that session of Acad (ADT or ABS).
    ;;  Please do not use-alter-modify this file without contacting Abbie Meador first.
    ;;  Created by Abbie Meador.
    ;;  Last modified on 09-26-08 by Abbie Meador.
    ;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    
      (setq mykey "sld")							;;Naming the slide image
      (setq myslidename "F:\\HBEDT2K7\\Setup\\WarnImage.sld")		;;Locating the slide file
      (setq dwgfile (strcat (getvar "dwgprefix")(getvar "dwgname")))	;;Setting value to dwfile variable, pulling info from dwg file
      (setq rfile (open dwgfile "r"))					;;Set value to rfile
      (setq dwgver (substr (read-line rfile) 1 6))				;;Set value to dwgver by reading version info from dwg file
      (close rfile)								;;Closes rfile where dwg version info was stored
    
    
    
      (cond						;;Conditions to assign acadv variable text info based off of dwg version
        
        ((= dwgver "AC1021")			;;If it is a 2007 version dwg it will automatically close out of this lsp routine
         (close)
         )
        ((= dwgver "AC1014")
         (setq acadv "AutoCAD R14")
         )
        ((= dwgver "AC1012")
         (setq acadv "AutoCAD R13")
         )
        ((= dwgver "AC1009")
         (setq acadv "AutoCAD R11 or R12")
         )
        ((= dwgver "AC1006")
         (setq acadv "AutoCAD R10")
         )
        ((= dwgver "AC1004")
         (setq acadv "AutoCAD R9")
         )
        ((= dwgver "AC1002")
         (setq acadv "AutoCAD R2.6")
         )
        ((= dwgver "AC1.50")
         (setq acadv "AutoCAD R2.05")
        )
        ((= dwgver "AC1015")
         (setq acadv "AutoCAD 2000")
        )
        ((= dwgver "AC1016")
         (setq acadv "AutoCAD 2000i")
        )
        ((= dwgver "AC1017")
         (setq acadv "AutoCAD 2002")
        )
        ((= dwgver "AC1018")
         (setq acadv "AutoCAD 2004")
        )
        ((= dwgver "AC1019")
         (setq acadv "AutoCAD 2005")
        )
        ((= dwgver "AC1020")
         (setq acadv "AutoCAD 2006")
        )
    ;;;;    ((= dwgver "AC1022")			;;For future use the 2008 ad 2009 version info is in here, but commented out
    ;;;;     (setq acadv "AutoCAD 2008")
    ;;;;    )
    ;;;;    ((= dwgver "AC1023")
    ;;;;     (setq acadv "AutoCAD 2009")
    ;;;;    )
    
      )						;;End of condition
    
    
    ;; (setq DwgName (strcat (vla-get-path(vla-get-activedocument(vlax-get-acad-object))) "\\" (vla-get-name(vla-get-activedocument(vlax-get-acad-object)))))
    ;; (vl-cmdf "vbastmt" (strcat "acadapplication.documents.open\"" DwgName,"\"TRUE"))
    
      (setq dclid (load_dialog "warnr14.dcl"))	;;Loading the DCL file
      (new_dialog "warnr14" dclid)
      (defun edit_action1 (val)
      (setq NT val)
      )						;;End of defun
      
      (setq width (dimx_tile mykey))		;;Get the width of the slide 
      (setq height (dimy_tile mykey))		;;Get the height of the slide
      (start_image mykey)				;;Start the slide definition
      (fill_image 0 0 width height -15)		;;Wipe out the background
      (slide_image 0 0 width height myslidename)   	;;Put the slide in the image area
      (end_image)	  				;;Finish the slide definition
    
      (action_tile "accept" "(unload_dialog)")	;;Closes dialog and leaves dwg open if Open button from DCL is clicked
      (action_tile "readonly" "(setq DwgName (strcat (vla-get-path(vla-get-activedocument(vlax-get-acad-object))) \"/\" (vla-get-name(vla-get-activedocument(vlax-get-acad-object)))))
      (done_dialog 1)")
      (action_tile "cancel" "(done_dialog)")	;;Closes dialog and dwg if Cancel button from DCL is clicked
    
    ;;(vla-activate (vla-open (vla-get-documents (vlax-get-acad-object)) dwgfile :VLAX-TRUE))))
    
      (set_tile "mytile" (strcat "YOU JUST OPENED AN  " acadv "  DWG IN 2007."))	;;Creates tile to be used on DCL that shows version variable info
    
      (setq ans(start_dialog))
    
      (unload_dialog dclid)
      (if (= ans 1)
      (vl-cmdf "vbastmt" (strcat "acadapplication.documents.open\"" DwgName"\",TRUE"))
      (progn
    
      (done_dialog)
      (command "_.close" "Y")
      ))
    
    ;;  (start_dialog)				;;Starts dialog box
    ;;  (done_dialog)				;;Finishes dialog box
    ;;  (command "_.close")				;;Closes dwg
    ;;  (command "y")				;;Answers yes to do you really want to close this file question
    ;;  (unload_dialog dclid)			;;Unloads dialog box
    
    ;;;;
    ;;;;End of the AutoLISP routine
    ;;;;
    Here's my modified DCL for the read only button:
    Code:
    /////////////////////////////////////////////////////////////////////////////////////////////////////
    //
    //  This program is designed to be used with the acaddoc.lsp file.
    //  They are to be stored locally on the users' machine under the product's support file area. 
    //	I.E.: C:Program Files_Autodesk Building Systems 2007_Support
    //  This program uses the slide image "WarnImage.sld" that is stored here: F:HBEDT2K7_Setup
    //  It was created to pop-up a warning when a dwg of a lower version is opened in a 2007 product.
    //  The user will get a choice to cancel out of the open, or go ahead with the open.
    //  Currently this pop-up will appear if the file is opened full out or read-only.
    //  It will not affect any dwgs that are already open in that session of Acad (ADT or ABS).
    //  Please do not use-alter-modify this file without contacting Abbie Meador first.
    //  Created by Abbie Meador.
    //  Last modified on 09-26-08 by Abbie Meador.
    //
    /////////////////////////////////////////////////////////////////////////////////////////////////////
    
    warnr14 : dialog {label = "WARNING!!! WARNING!!!";	//Controls the text on the pop-up's title
    
    	: image {		//This creates a stripe or bar of color along the top
    	key = "im";		//Creating a variable called "im" for this stripe
    	height = 1.0;		//Setting height of stripe to 1
    	width = 1.0;		//Setting width of stripe to 1
    	color = 1;		//Setting color of stripe to 1 = Red
    	}			//Ends stripe "im" creation
    
    	:row{			//Creates a row
    	: image { 		//Adds in the image from the LSP for the Slide
              key = "sld"; 		//Calls the slide image
              height = 0; 		//Sets the height of the image
              width = 15;  		//Sets the width of the image
              color = -15;		//Sets the color to the background color -15 = grey
              is_enabled = false; 
              is_tab_stop = false;
              }			//Ends row for image slide
    	
    	: paragraph {			//Begins a paragraph of text
    	: text { key = "mytile"; }	//Calls the tile created in the LSP to print out in a text line
    	: text_part {
    	  label = "Verify this file is Read-only before clicking 'Open' (Check the header).";
    	  }
    	: text_part {
    	  label = "If you ignore this warning and end up saving this as a 2007 dwg,";
    	  }
    	: text_part {
    	  label = "YOU WILL REPAIR THIS FILE ON YOUR OWN TIME!!";
    	  }	
    	}			//End paragraph of text
    	}			//End of row
    
    	: image {		//This creates a stripe or bar of color underneath the paragraph text
    	key = "im2";		//Creating a variable called "im2" for this stripe
    	height = 1.0;		//Setting height of stripe to 1
    	width = 1.0;		//Setting width of stripe to 1
    	color = 1;		//Setting color of stripe to 1 = Red
    	}			//Ends stripe "im2" creation
    
    	: row {			//Begins row for buttons
    	: button {		//Begins first button creation
    	label = "CANCEL";	//Labels first button cancel
    	key = "cancel";		//Attaches a call of cancel to the button
    	mnemonic = "C";		//Sets up a keyboard shortcut for the button
    	alignment = centered;	//Alignment of the button
    	width = 0.5;		//Sets width of button
    	height = 3;		//Sets height of button
    	is_default = true;	//Sets the default selection to this button...If user hits enter this button will be selected
    	}			//Ends first button
    
    
    	: button {		//Begins second button creation
    	fixed_width = true;	//Sets a fixed width of button
    	fixed_height = true;	//Sets a fixed height of button
    	label = "Read-Only";	//Labels second button open
    	key = "readonly";	//Attaches a call of readonly to the button
    	mnemonic = "R";		//Sets up a keyboard shortcut for the button
    	}			//Ends second button
    
    	
    	: button {		//Begins third button creation
    	fixed_width = true;	//Sets a fixed width of button
    	fixed_height = true;	//Sets a fixed height of button
    	label = "Open";		//Labels third button open
    	key = "accept";		//Attaches a call of accept to the button
    	mnemonic = "O";		//Sets up a keyboard shortcut for the button
    	}			//Ends third button
    	}			//Ends row
    }				//Ends program
    CAD user since '95, CAD Mgr since '07, Mech Eng
    R10, R14, 2000i, 2002, 2004, ABS 2007, AMEP 2009, 2011 & 2012, RMEP 2011 & 2012
    Author of: http://ab-nerd-disc.blogspot.com/

  8. #38
    I could stop if I wanted to ameador's Avatar
    Join Date
    2006-02
    Posts
    414

    Default Re: LSP & DCL Change Font/Colors & Add Image?

    Ok...can anyone work with this....
    We'd have to change the alert that states it's a read-write to engage our lsp/dcl code. If it's readonly then just show the alert, not our lsp/dcl code dialog box.

    Code:
    (defun is_drawing_read_only ()
      (if (eq
    (vla-get-readonly (vla-get-activedocument (vlax-get-acad-object)))
    :vlax-true)
        (progn
         
    (alert "This drawing is read-only.")
         
    T
        )
       
    (progn
          (alert "This drawing is read-write.")
          nil
       
    )
      )
    )
    CAD user since '95, CAD Mgr since '07, Mech Eng
    R10, R14, 2000i, 2002, 2004, ABS 2007, AMEP 2009, 2011 & 2012, RMEP 2011 & 2012
    Author of: http://ab-nerd-disc.blogspot.com/

  9. #39
    I could stop if I wanted to
    Join Date
    2006-07
    Posts
    233

    Default Re: LSP & DCL Change Font/Colors & Add Image?

    Code:
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;
    ;;  This program is designed to be used with the warnr14.dcl file.
    ;;  They are to be stored locally on the users' machine under the product's support file area. 
    ;;	I.E.: C:Program Files_Autodesk Building Systems 2007_Support
    ;;  This program uses the slide image "WarnImage.sld" that is stored here: F:HBEDT2K7_Setup
    ;;  It was created to pop-up a warning when a dwg of a lower version is opened in a 2007 product.
    ;;  The user will get a choice to cancel out of the open, or go ahead with the open.
    ;;  Currently this pop-up will appear if the file is opened full out or read-only.
    ;;  It will not affect any dwgs that are already open in that session of Acad (ADT or ABS).
    ;;  Please do not use-alter-modify this file without contacting Abbie Meador first.
    ;;  Created by Abbie Meador.
    ;;  Last modified on 09-26-08 by Abbie Meador.
    ;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    (defun is_drawing_read_only ()
      (if (eq(vla-get-readonly (vla-get-activedocument (vlax-get-acad-object))):vlax-true)
        (progn     
    (alert "This drawing is read-only.")
        );; end of progn
       
    (progn
          (alert "This drawing is read-write.")
          (drawing_is_read-write)
       );; end of progn
      );; end of if
    );; end of defun is_drawing_read_only
    
    (defun drawing_is_read_write ()
      (setq mykey "sld")							;;Naming the slide image
      (setq myslidename "F:\\HBEDT2K7\\Setup\\WarnImage.sld")		;;Locating the slide file
      (setq dwgfile (strcat (getvar "dwgprefix")(getvar "dwgname")))	;;Setting value to dwfile variable, pulling info from dwg file
      (setq rfile (open dwgfile "r"))					;;Set value to rfile
      (setq dwgver (substr (read-line rfile) 1 6))				;;Set value to dwgver by reading version info from dwg file
      (close rfile)								;;Closes rfile where dwg version info was stored
    
    
    
      (cond						;;Conditions to assign acadv variable text info based off of dwg version
        
        ((= dwgver "AC1021")			;;If it is a 2007 version dwg it will automatically close out of this lsp routine
         (close)
         )
        ((= dwgver "AC1014")
         (setq acadv "AutoCAD R14")
         )
        ((= dwgver "AC1012")
         (setq acadv "AutoCAD R13")
         )
        ((= dwgver "AC1009")
         (setq acadv "AutoCAD R11 or R12")
         )
        ((= dwgver "AC1006")
         (setq acadv "AutoCAD R10")
         )
        ((= dwgver "AC1004")
         (setq acadv "AutoCAD R9")
         )
        ((= dwgver "AC1002")
         (setq acadv "AutoCAD R2.6")
         )
        ((= dwgver "AC1.50")
         (setq acadv "AutoCAD R2.05")
        )
        ((= dwgver "AC1015")
         (setq acadv "AutoCAD 2000")
        )
        ((= dwgver "AC1016")
         (setq acadv "AutoCAD 2000i")
        )
        ((= dwgver "AC1017")
         (setq acadv "AutoCAD 2002")
        )
        ((= dwgver "AC1018")
         (setq acadv "AutoCAD 2004")
        )
        ((= dwgver "AC1019")
         (setq acadv "AutoCAD 2005")
        )
        ((= dwgver "AC1020")
         (setq acadv "AutoCAD 2006")
        )
    ;;;;    ((= dwgver "AC1022")			;;For future use the 2008 ad 2009 version info is in here, but commented out
    ;;;;     (setq acadv "AutoCAD 2008")
    ;;;;    )
    ;;;;    ((= dwgver "AC1023")
    ;;;;     (setq acadv "AutoCAD 2009")
    ;;;;    )
    
      )						;;End of condition
    
    
    ;; (setq DwgName (strcat (vla-get-path(vla-get-activedocument(vlax-get-acad-object))) "\\" (vla-get-name(vla-get-activedocument(vlax-get-acad-object)))))
    ;; (vl-cmdf "vbastmt" (strcat "acadapplication.documents.open\"" DwgName,"\"TRUE"))
    
      (setq dclid (load_dialog "warnr14.dcl"))	;;Loading the DCL file
      (new_dialog "warnr14" dclid)
      (defun edit_action1 (val)
      (setq NT val)
      )						;;End of defun
      
      (setq width (dimx_tile mykey))		;;Get the width of the slide 
      (setq height (dimy_tile mykey))		;;Get the height of the slide
      (start_image mykey)				;;Start the slide definition
      (fill_image 0 0 width height -15)		;;Wipe out the background
      (slide_image 0 0 width height myslidename)   	;;Put the slide in the image area
      (end_image)	  				;;Finish the slide definition
    
      (action_tile "accept" "(unload_dialog)")	;;Closes dialog and leaves dwg open if Open button from DCL is clicked
      (action_tile "readonly" "(setq DwgName (strcat (vla-get-path(vla-get-activedocument(vlax-get-acad-object))) \"/\" (vla-get-name(vla-get-activedocument(vlax-get-acad-object)))))
      (done_dialog 1)")
      (action_tile "cancel" "(done_dialog)")	;;Closes dialog and dwg if Cancel button from DCL is clicked
    
    ;;(vla-activate (vla-open (vla-get-documents (vlax-get-acad-object)) dwgfile :VLAX-TRUE))))
    
      (set_tile "mytile" (strcat "YOU JUST OPENED AN  " acadv "  DWG IN 2007."))	;;Creates tile to be used on DCL that shows version variable info
    
      (setq ans(start_dialog))
    
      (unload_dialog dclid)
      (if (= ans 1)
      (vl-cmdf "vbastmt" (strcat "acadapplication.documents.open\"" DwgName"\",TRUE"))
      (progn
    
      (done_dialog)
      (command "_.close" "Y")
      ))
    
    ;;  (start_dialog)				;;Starts dialog box
    ;;  (done_dialog)				;;Finishes dialog box
    ;;  (command "_.close")				;;Closes dwg
    ;;  (command "y")				;;Answers yes to do you really want to close this file question
    ;;  (unload_dialog dclid)			;;Unloads dialog box
    );; end of defun drawing_is_read_write
    
    (is_drawing_read_only)
    ;;;;
    ;;;;End of the AutoLISP routine
    ;;;;

  10. #40
    I could stop if I wanted to ameador's Avatar
    Join Date
    2006-02
    Posts
    414

    Smile Re: LSP & DCL Change Font/Colors & Add Image?

    Good morning,

    Lions60: Thank you for working on this late Friday. I will drop it in and check it out this morning. I'll report back w/ my findings.
    CAD user since '95, CAD Mgr since '07, Mech Eng
    R10, R14, 2000i, 2002, 2004, ABS 2007, AMEP 2009, 2011 & 2012, RMEP 2011 & 2012
    Author of: http://ab-nerd-disc.blogspot.com/

Page 4 of 6 FirstFirst 123456 LastLast

Similar Threads

  1. LISP to change layer colors to random colors
    By mtubbs in forum AutoLISP
    Replies: 10
    Last Post: 2007-04-27, 05:39 AM
  2. change colors within blocks
    By chad.beussink in forum AutoLISP
    Replies: 11
    Last Post: 2007-01-02, 03:07 PM
  3. Font will change to another font when opening a drawing
    By mellyskelly in forum AutoCAD General
    Replies: 2
    Last Post: 2006-10-21, 05:01 AM
  4. Colors change
    By nikoloz in forum AutoCAD Mechanical - General
    Replies: 2
    Last Post: 2005-09-29, 08:57 AM
  5. Replies: 5
    Last Post: 2005-01-04, 06:19 PM

Posting Permissions

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