Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: insert .bmp

  1. #1
    100 Club timothyjturner's Avatar
    Join Date
    2005-09
    Location
    Columbus, OH
    Posts
    101
    Login to Give a bone
    0

    Default insert .bmp

    I am working on a lisp where the user can choose to insert their digital signature into a drawing. We have our digital signatures in .bmp format in separate locations on our computers. I am looking for a line of code that will let the user browse to their .bmp file and insert it. I tried using (command "_imageattach" ...) but i'm having no luck. When the user browses for the .bmp it prompts them for all this other data that I already have preset in my program... i.e. insertion pt, size, rot angle.... I just need something to help the user browse, everythign else is set.

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

    Default Re: insert .bmp

    Look into the getfiled function.
    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
    100 Club timothyjturner's Avatar
    Join Date
    2005-09
    Location
    Columbus, OH
    Posts
    101
    Login to Give a bone
    0

    Default Re: insert .bmp

    The getfileid function seems helpful, but how do I insert a .bmp without using the command _imageattach? Is there a better method that will not bring up the extra dialog box asking for the details I mentioned above?

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

    Default Re: insert .bmp

    Quote Originally Posted by timothyjturner
    The getfileid function seems helpful, but how do I insert a .bmp without using the command _imageattach? Is there a better method that will not bring up the extra dialog box asking for the details I mentioned above?
    Have you tried using the command line version of the image command? You would need to supply the filename from the getfiled function.

    There is probably some visual lispcode that would do this without even using the command line.
    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

  5. #5
    100 Club timothyjturner's Avatar
    Join Date
    2005-09
    Location
    Columbus, OH
    Posts
    101
    Login to Give a bone
    0

    Default Re: insert .bmp

    I messed around with this a little bit and I seem to have the same type of problem... once I execute the command, it pretty much shuts down my program... I insert and it asks me all the questions again via the command line...

    Somehow I need to...

    Do previous lisp commands ---> Insert Image ---> Modify image properties via lisp ---> finish lisp program

    With no interuptions

  6. #6
    AUGI Addict
    Join Date
    2005-08
    Posts
    1,043
    Login to Give a bone
    0

    Default Re: insert .bmp

    Do something like
    Code:
    (initdia 0)
    (command "_.image")
    This will supress the dialog box. Run it once so that you know how to answer all the prompts.

  7. #7
    AUGI Addict .T.'s Avatar
    Join Date
    2000-12
    Location
    Lost
    Posts
    1,473
    Login to Give a bone
    0

    Default Re: insert .bmp

    Wouldn't "-image" also work?

  8. #8
    AUGI Addict
    Join Date
    2005-08
    Posts
    1,043
    Login to Give a bone
    0

    Default Re: insert .bmp

    Quote Originally Posted by timcreary
    Wouldn't "-image" also work?
    I tried it before I posted. Didn't work.
    Command: (command "-image")
    Unknown command "-IMAGE". Press F1 for help.
    nil

  9. #9
    AUGI Addict .T.'s Avatar
    Join Date
    2000-12
    Location
    Lost
    Posts
    1,473
    Login to Give a bone
    0

    Default Re: insert .bmp

    That's strange; it works for me. What version are you running?

  10. #10
    100 Club timothyjturner's Avatar
    Join Date
    2005-09
    Location
    Columbus, OH
    Posts
    101
    Login to Give a bone
    0

    Default Re: insert .bmp

    I'm still having trouble. Maybe I'm just not understanding how to answer the prompts from the routine and continue on with the program? Even if i answer the prompts manually...it does not complete the rest of the program. Also with this method it did not even bring up a dialog box for me select the bmp file....let me post my entire code, maybe this will help...

    Code:
    (defun C:reviewstamp ()
    	(setq os (getvar "osmode"))
    	(setq cl (getvar "clayer"))
    	(setvar "osmode" 0)
    	(setq test 1)
    		(setq blockinsert (getstring "Is this block Approved? approved as Noted? to be Revised? <A/N/R>:"))
    		(cond
    		((or (= blockinsert "A") (= blockinsert "a"))
    			(setq insertstring "\\\\Fileman\\MAC\\Engineering\\Drawings\\AutoCAD Designers\\acad2004\\program files\\acadlisp\\reviewstamp\\approved.dwg")
    		)
    		((or (= blockinsert "N") (= blockinsert "n"))
    			(setq insertstring "\\\\Fileman\\MAC\\Engineering\\Drawings\\AutoCAD Designers\\acad2004\\program files\\acadlisp\\reviewstamp\\approvedasnoted.dwg")
    		)
    		((or (= blockinsert "R") (= blockinsert "r"))
    			(setq insertstring "\\\\Fileman\\MAC\\Engineering\\Drawings\\AutoCAD Designers\\acad2004\\program files\\acadlisp\\reviewstamp\\revise.dwg")
    		)
    	)
    	(setq blkscale (getvar "DIMSCALE"))
    	(setq pt (getpoint "Select insertion point:"))
    	(command "insert" insertstring pt blkscale "" 0)
    	(command "explode" "L" "")
    	(setq sigdatepty (- (nth 1 pt) (* 0.9375 (getvar "DIMSCALE"))))
    	(setq sigx (- (nth 0 pt) (* 0.5625 (getvar "DIMSCALE"))))
    	(setq datex (+ (nth 0 pt) (* 1.5 (getvar "DIMSCALE"))))
    	(setq bmpptx (- (nth 0 pt) (* 1.5 (getvar "DIMSCALE"))))
    	(setq sigpt (list sigx sigdatepty 0))
    	(setq datept (list datex sigdatepty 0))
    	(setq bmppt (list bmpptx sigdatepty 0))
    	(setq signature (getstring "\nWould you like to Type your signature or insert digital signature .bmp from a File? <T/F>:"))
    		(cond
    			((or (= signature "T") (= signature "t"))
    				(setq printsig (getstring T "Type your signature:"))
    				(setq txtsize (* 0.1875 (getvar "DIMSCALE")))
    				(command "clayer" "text")
    				(command "Text" "j" "bc" sigpt txtsize "0" printsig "")
    			)
    			((or (= signature "F") (= signature "f"))
    				(initdia 0)
    				(command "_.image" "a" bmppt (getvar "DIMSCALE") 0)
    					
    			)
    			
    		)
    	(setq date (rtos (getvar "CDATE") 2 8))
    	(setq datetxt (strcat (substr date 5 2) "/" (substr date 7 2) "/" (substr date 1 4)))
    	(setq txtsize (* 0.125 (getvar "DIMSCALE")))
    	(command "Text" "j" "bc" datept txtsize "0" datetxt "")
    	(command "clayer" cl)
    	(setvar "osmode" os)
    	
    )
    Last edited by timothyjturner; 2006-03-13 at 06:49 PM.

Page 1 of 2 12 LastLast

Similar Threads

  1. Insert DWG in DWG via vb.Net
    By drewj in forum Dot Net API
    Replies: 2
    Last Post: 2012-12-03, 05:01 PM
  2. Map Insert VS FDO
    By jenniferchavez in forum AutoCAD Map 3D - Data Connect (FDO)
    Replies: 1
    Last Post: 2010-01-12, 11:08 PM
  3. Insert Sheet List - Won't insert
    By chris.klinert in forum ACA General
    Replies: 2
    Last Post: 2008-12-18, 03:45 PM
  4. Insert OLE
    By a.r.t.studio in forum AutoCAD General
    Replies: 2
    Last Post: 2005-07-07, 10:59 PM
  5. Name that insert
    By Maverick91 in forum AutoCAD General
    Replies: 2
    Last Post: 2005-06-14, 01:25 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
  •