See the top rated post in this thread. Click here

Page 3 of 3 FirstFirst 123
Results 21 to 27 of 27

Thread: Inserting blocks in table cells using LISP

  1. #21
    Member costas.vassiliou's Avatar
    Join Date
    2004-07
    Location
    Nicosia - CYPRUS
    Posts
    34
    Login to Give a bone
    0

    Default Re: Inserting blocks in table cells using LISP

    Good morning Fixo,

    I am using this nice lisp program that inserts blocks in a dwg.
    The problem I have is tah what ever scale I specify for the block,
    the block inserted in the table has a different scale.

    I attatch a dwg with 3 blocks. The blocks in the table created are of scale 0.1, eventhough the block scale parameter specified in the lisp program is 5.0.

    Can you please see where I go wrong ?
    I have a suspicion that lisp sets autofit to YES and blockscale doesn't work. I am not sure.

    I also attach the lisp file BDT.

    Regards
    Costas
    Attached Files Attached Files

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

    Default Re: Inserting blocks in table cells using LISP

    Quote Originally Posted by costas.vassiliou View Post
    Good morning Fixo,

    I am using this nice lisp program that inserts blocks in a dwg.
    The problem I have is tah what ever scale I specify for the block,
    the block inserted in the table has a different scale.

    I attatch a dwg with 3 blocks. The blocks in the table created are of scale 0.1, eventhough the block scale parameter specified in the lisp program is 5.0.

    Can you please see where I go wrong ?
    I have a suspicion that lisp sets autofit to YES and blockscale doesn't work. I am not sure.

    I also attach the lisp file BDT.

    Regards
    Costas
    Ok, will try

    ~'J'~

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

    Default Re: Inserting blocks in table cells using LISP

    Quote Originally Posted by costas.vassiliou View Post
    Costas
    Sorry, Costas

    I can't solve it

    You can just scale this table manually after

    ~'J'~

  4. #24
    Woo! Hoo! my 1st post
    Join Date
    2005-10
    Posts
    1
    Login to Give a bone
    0

    Default Re: Inserting blocks in table cells using LISP

    im sorry how do i run this?

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

    Default Re: Inserting blocks in table cells using LISP

    Welcome on board
    Usualy lisp loads with its commands, i.e
    if you have lisp like:
    Code:
    (defun C:ahha()
    .....etc
    (princ)
    )
    So you have just type in the command line AHHA or ahha
    to run this lisp

  6. #26
    Woo! Hoo! my 1st post
    Join Date
    2013-11
    Posts
    1
    Login to Give a bone
    0

    Default Re: Inserting blocks in table cells using LISP

    Hi Costas,
    I have accidently come across this routine and realised that you may have solved my problem partly.
    I am looking for a lisp routine taht can create a legened with the following headings (Symbol, Block Name, Block Description, Quantity)
    Do you think you could modify this routine to do that for me.
    Much appreciated.

  7. #27
    Member
    Join Date
    2016-03
    Posts
    3
    Login to Give a bone
    0

    Default Re: Inserting blocks in table cells using LISP

    Hi Peter,

    Is there any way to modify this to select an existing table and convert a column with block names into symbols? I have a point table linked to excel that has been heavily formatted already. I downloaded the "CP311-3_Visual_LISP_Table_Magic" you linked to and it is really impressive. It's quite beyond my capabilities to even read through. Any help would be appreciated.


    Quote Originally Posted by peter View Post
    Here is a portion of code from my LISP Table Magic course I taught last year at Autodesk University. The course is downloadable and will do what you want listed above. If you do a search on this forum for LISP Table magic I think I posted the code here too.

    The function listed below with the errortrap will convert a column in a table with block names in it, into symbols.

    Peter


    Code:
    
    (defun AU06:ConvertBlockNameToSymbol (objTable       ; Object Table
                                          intNumColumn   ; Integer Column Index
                                          / 
                                          intNumRow      ; Integer Row Index
                                          intObjectID    ; Integer Block Definition Object ID
                                          strBlockName)  ; String Block Name
     (repeat (- (setq intNumRow (vla-get-rows objTable)) 2)
      (setq intNumRow   (1- intNumRow ))
      (and 
       (AU06:Errortrap (quote (setq strBlockName (vla-getText objTable intNumRow intNumColumn))))
       (AU06:Errortrap (quote (setq intObjectID (vla-get-objectID 
                                                 (vla-item 
                                                  (vla-get-blocks
                                                   (vla-get-activedocument
                                                    (vlax-get-acad-object)))
                                                  strBlockName)))))                   
       (AU06:Errortrap
        (quote (vla-setcelltype objTable intNumRow intNumColumn acBlockCell)))
       (AU06:Errortrap
        (quote (vla-setblocktablerecordID objTable intNumRow intNumColumn intObjectID :vlax-true)))
       (AU06:Errortrap
        (quote (vla-SetCellAlignment objTable intNumRow intNumColumn acMiddleCenter))))))
    ;****************************************************************************************************
    (defun AU06:ErrorTrap (symFunction ; Symbol (lisp expr. wrapped in a quote expression)
                           / 
                           objError    ; Object Error test
                           result)     ; Result of wrapped lisp expression.
     (if (vl-catch-all-error-p
          (setq objError (vl-catch-all-apply
                         '(lambda (X)(set X (eval symFunction)))
                          (list 'result)))) 
      nil  
      (if result result 'T)
     )
    )
    
    

Page 3 of 3 FirstFirst 123

Similar Threads

  1. Copying Blocks in Table Cells *
    By stilesj in forum AutoCAD Wish List
    Replies: 1
    Last Post: 2013-11-17, 12:02 AM
  2. Replies: 0
    Last Post: 2013-01-23, 04:01 AM
  3. Dynamic blocks inside table cells
    By huascarfdez in forum Dynamic Blocks - Technical
    Replies: 2
    Last Post: 2010-08-20, 06:51 PM
  4. Blocks with attributes in Table Cells
    By h.jobe in forum AutoCAD General
    Replies: 5
    Last Post: 2010-06-22, 04:13 PM
  5. inserting blocks into table cells
    By Tom.Weinstein.137333 in forum AutoCAD General
    Replies: 6
    Last Post: 2008-09-25, 05:23 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
  •