Results 1 to 4 of 4

Thread: Prompting Properties of Selected Entity on Separate Lines

  1. #1
    Active Member
    Join Date
    2005-03
    Location
    From Kerala, Currently located at Bangalore, India
    Posts
    95
    Login to Give a bone
    0

    Default Prompting Properties of Selected Entity on Separate Lines

    Hi All,
    This program is to list the properties of a selected object.
    But it prompts all the properties on single line. I would like the properties listed one by one on separate lines. How do I modify it to do so?

    Code:
    (defun c:Prop ()
    (setq en(car(entsel)))
    (foreach a (entget en) (princ a))
    (PRINC)
    )

  2. #2
    Active Member
    Join Date
    2005-03
    Location
    From Kerala, Currently located at Bangalore, India
    Posts
    95
    Login to Give a bone
    0

    Default Re: Prompting Properties of Selected Entity on Separate Lines

    Well, I did something like this;
    Code:
    (defun c:Prop ()
    (setq en(car(entsel)))
    (foreach a (entget en) (princ a)
      (prompt "\n")
    )
    (PRINC)
    )
    Anything better?

  3. #3
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,805
    Login to Give a bone
    0

    Default Re: Prompting Properties of Selected Entity on Separate Lines

    Quote Originally Posted by harilalmn View Post
    Well, I did something like this;
    Anything better?
    You might want to (entget) just once, then handle the list.

    Code:
    
    (defun c:Prop ()
    (setq en (entget (car (entsel))))
    (foreach a en
      (princ a)
      (prompt "\n")
    )
    (PRINC)
    )
    
    ;;; alternative
    (defun c:Prop (/ en)
      (setq en (entget (car (entsel))))
      (mapcar '(lambda (x) (princ x)(princ "\n")) en)
      (princ)
    )
    
    R.K. McSwain | CAD Panacea |

  4. #4
    AUGI Addict
    Join Date
    2008-02
    Posts
    1,141
    Login to Give a bone
    0

    Default Re: Prompting Properties of Selected Entity on Separate Lines

    Code:
    (defun c:Info (/ opt obj)
      ;; VLA & DXF Info of selected Primary or Nested object
      ;; Alan J. Thompson
      (initget 0 "Nested Primary")
      (setq opt (cond ((getkword "\nSpecify selection mode [Nested/Primary] <Primary>: "))
                      ("Primary")
                )
      )
      (if (setq obj (car ((if (eq opt "Primary")
                            entsel
                            nentsel
                          )
                           (strcat "\nSelect " opt " object for VLA & DXF info: ")
                         )
                    )
          )
        (progn
          (textscr)
          (princ "\nVLA Info:\n\n")
          (vlax-dump-object (vlax-ename->vla-object obj) T)
          (princ "\nDXF Info:\n")
          (mapcar 'print (entget obj '("*")))
        )
      )
      (princ)
    )

Similar Threads

  1. Delete XData with a specified application name from a selected entity
    By peter in forum Bridging the Gap: LISP -> .NET -> LISP
    Replies: 6
    Last Post: 2015-06-09, 03:10 PM
  2. command reactor selected entity
    By Serhan_BAKIR in forum AutoLISP
    Replies: 3
    Last Post: 2012-01-13, 01:10 PM
  3. Replies: 3
    Last Post: 2010-03-01, 06:23 PM
  4. Deleting surface lines also deletes entity lines?
    By jmmacdougall2 in forum AutoCAD Civil 3D - Surfaces
    Replies: 2
    Last Post: 2008-02-08, 05:25 AM
  5. Object properties palette not showing selected Objects properties
    By timothyjturner in forum AutoCAD General
    Replies: 22
    Last Post: 2007-08-10, 05:21 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
  •