Results 1 to 3 of 3

Thread: read the value of a variable of a list

  1. #1
    Member
    Join Date
    2009-01
    Posts
    33
    Login to Give a bone
    0

    Default read the value of a variable of a list

    Hi,
    i nedd read a value of a variabile for print, export in txt and more
    I don't Know the function for rea a variabile.....
    Can you help me?

    Code:
    (defun c:test ()
      (setq D1 (strcat "cod1" "*" "10PZ"))
      (setq D2 (strcat "cod2" "*" "8SX"))
      (setq D2 (strcat "cod2" "*" "8DX"))
      (setq lista '(D1 D2 D2))
      (foreach x lista
        (alert x)
      )
    );def
    Last edited by BlackBox; 2014-11-07 at 12:46 PM. Reason: Please use [CODE] Tags

  2. #2
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,719
    Login to Give a bone
    0

    Default Re: read the value of a variable of a list

    Quote Originally Posted by blubossa View Post
    Hi,
    i nedd read a value of a variabile for print, export in txt and more
    I don't Know the function for rea a variabile.....
    Can you help me?

    Code:
    (defun c:test ()
      (setq D1 (strcat "cod1" "*" "10PZ"))
      (setq D2 (strcat "cod2" "*" "8SX"))
      (setq D2 (strcat "cod2" "*" "8DX"))
      (setq lista '(D1 D2 D2))
      (foreach x lista
        (alert x)
      )
    );def
    Not sure if I understand what you mean... Something like this, from which you can copy the output from command line?

    Code:
    (defun c:FOO (/ D1 D2 D3)
      (setq D1 (strcat "cod1" "*" "10PZ"))
      (setq D2 (strcat "cod2" "*" "8SX"))
      (setq D3 (strcat "cod2" "*" "8DX"))
      (foreach x (list D1 D2 D3)
        (prompt (strcat "\n" x))
      )
      (textpage)
      (princ)
    )
    [Edit] - Also, don't forget to localize your variables, unless you need them to be global.

    Cheers
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  3. #3
    Member
    Join Date
    2009-01
    Posts
    33
    Login to Give a bone
    0

    Default Re: read the value of a variable of a list

    Hi,
    is correct.

    is correct.
    I'm trying to write a routine that allows me to create a list of nomni code according to certain characteristics.
    I'll have to think again because it is not yet clear to me how it should work .....

    Thanks.
    bb

Similar Threads

  1. Setting a variable from a list
    By mbrandt5 in forum AutoLISP
    Replies: 10
    Last Post: 2015-05-22, 07:05 PM
  2. Read Only from AutoCAD Recently Used List
    By Wish List System in forum AutoCAD Wish List
    Replies: 0
    Last Post: 2015-01-14, 05:36 PM
  3. Variable to control Save if a drawing is open Read Only
    By autocad.wishlist1734 in forum AutoCAD Wish List
    Replies: 4
    Last Post: 2008-02-27, 07:18 PM
  4. System Variable for READ ONLY
    By autocad.wishlist1734 in forum AutoCAD Wish List
    Replies: 1
    Last Post: 2007-06-23, 12:42 PM
  5. How can I change the variable PSTYLEMODE (read only)
    By JMonrex Gadgude in forum AutoCAD Plotting
    Replies: 5
    Last Post: 2005-07-13, 07:42 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
  •