Results 1 to 4 of 4

Thread: Blockattributes to excel and back / Picture to excel

  1. #1
    Login to Give a bone
    0

    Default Blockattributes to excel and back / Picture to excel

    Hello guys
    I'm writting a lisp routine to create a .xslx list for attributes of dynamic blocks and a way back for importing.
    The lisp automatically creates a formatted .xlsx file with header and so on.
    This all works perfectly.

    But now it should load the brand of my company automatically to the header of my .xslx file.

    Is this possible with lisp?

    I want to put the .png file on a fixed place and in a fixed size to the excel file.

    Thank you in advanced

    Best regards
    Kurt
    Attached Files Attached Files

  2. #2
    Login to Give a bone
    0

    Default Re: Blockattributes to excel and back / Picture to excel

    Anyone an idea?
    Is it so difficult to give a picture with size and position to excel by lisp?

    BR

  3. #3
    Member
    Join Date
    2006-07
    Location
    Currently Vancouver BC
    Posts
    47
    Login to Give a bone
    0

    Default Re: Blockattributes to excel and back / Picture to excel

    (setq pics (vlax-invoke-method csht "Pictures"))
    (setq ins (vlax-invoke-method pics "Insert" "c:\\temp\\1.png"))

  4. #4
    AUGI Addict fixo's Avatar
    Join Date
    2005-05
    Location
    Pietari, Venäjä
    Posts
    1,269
    Login to Give a bone
    0

    Default Re: Blockattributes to excel and back / Picture to excel

    Hi, Kurt,
    in LISTOUT.lsp try this code:
    Code:
        ;;_______________________instead of text___________________________;;
    	;;;        (vlax-put-property
    	;;;		cll
    	;;;		"Item"
    	;;;		row
    	;;;		colm
    	;;;		(vl-princ-to-string "ANDRITZ")
    	;;;      	)
        ;;____________________________Use this methods______________________;;
        	(setq ANDRITZRang (vlax-get-property csht "Range" "J1:M5"))
    	(setq ANDRITZ (vlax-get-property csht "Range" "J1:M5"))
    	(vlax-put-property ANDRITZ "MergeCells" :vlax-true)
        	(vlax-put-property ANDRITZ "Horizontalalignment" (vlax-make-variant -4108 3))
        	(vlax-put-property ANDRITZ "VerticalAlignment" (vlax-make-variant -4108 3))
        	(setq ANDRITZFonto (vlax-get-property ANDRITZRang "Font"))
        	(vlax-put-property ANDRITZFonto "Bold" (vlax-make-variant 1 11))
        	(vlax-put-property ANDRITZFonto "Size" (vlax-make-variant 48 5))
    	(vlax-put-property ANDRITZFonto "Name" (vlax-make-variant "Aharoni" 12))
        	(vlax-put-property ANDRITZFonto "Colorindex" (vlax-make-variant 41))
     (setq wid (vlax-get  ANDRITZ 'Width)
           hgt(vlax-get  ANDRITZ 'Height)
           lft (vlax-get  ANDRITZ 'Left)
           top (vlax-get  ANDRITZ 'Top))
    
        (vlax-invoke-method ANDRITZ 'Select)
    
            (setq Shapes (vl-catch-all-apply 'vlax-get-property
    			       (list  csht 'Shapes)))
        
        (setq Shape	(vlax-invoke-method
    		  Shapes
    		  'AddPicture
    		  (findfile "C:/Temp/test.jpg")
    		  :vlax-true
    		  :vlax-true
    		  lft
    		  top
    		  (vlax-make-variant wid 3) ;|cell width|;
    		  (vlax-make-variant hgt 3) ;|cell height|;
    		)
        )
    	;;; rest your code here (wthout changes)

Similar Threads

  1. 2016: Excel or Text Back To CTB?
    By omorah in forum AutoCAD Customization
    Replies: 2
    Last Post: 2015-06-11, 05:27 PM
  2. Replies: 5
    Last Post: 2013-10-16, 05:39 PM
  3. Replies: 1
    Last Post: 2012-08-08, 05:50 PM
  4. Get focus back to Excel
    By buicaominhthe in forum VBA/COM Interop
    Replies: 4
    Last Post: 2009-12-21, 08:09 AM
  5. Replies: 1
    Last Post: 2009-04-29, 11:03 AM

Posting Permissions

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