Results 1 to 3 of 3

Thread: Problem with properties palette not showing current layer after insert lisp

  1. #1
    I could stop if I wanted to
    Join Date
    2001-10
    Location
    Defragging the internets.
    Posts
    350
    Login to Give a bone
    0

    Default Problem with properties palette not showing current layer after insert lisp

    I have noticed that when I run lisp routines to insert a block with an attribute, the properties palette does not show the current layer.
    This happens with autocad 2018.

    Code:
    (defun c:test2 ()
    (setq melay (getvar "clayer"))
    (command "-layer" "m" "test" "" )
    (setvar "attdia" 0) 
    (setq meattval "x")
    (command "-insert" "myblock_with_attribute" "s" "1" "r" "0" pause meattval )
    (setvar "clayer" melay)
    (setvar "attdia" 1)
    )
    The ribbon will show the correct layer, but the properties palette shows the "test" layer.
    Any help with this?
    Last edited by framedNlv; 2019-10-29 at 08:10 PM.

  2. #2
    I could stop if I wanted to
    Join Date
    2001-10
    Location
    Defragging the internets.
    Posts
    350
    Login to Give a bone
    0

    Default Re: Problem with properties palette not showing current layer after insert lisp

    Code:
    (defun c:test2 ()
    (setq melay (getvar "clayer"))
    (command "-layer" "m" "test" "" )
    (setvar "attdia" 0) 
    (setq meattval "x")
    (initcommandversion );;;<---this seems to help
    (command "-insert" "myblock_with_attribute" "s" "1" "r" "0" pause meattval )
    (setvar "clayer" melay)
    (setvar "attdia" 1)
    )

  3. #3
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,658
    Login to Give a bone
    0

    Default Re: Problem with properties palette not showing current layer after insert lisp

    Untested:
    Code:
    (defun test2 ( / melay PropOnOff meattval)
    	(setq melay (getvar "clayer")
    	      PropOnOff (getvar "opmstate")
    	)
    	(if (> PropOnOff 0)(command-s "propertiesclose"))
    	(command "-layer" "m" test "" )
    	(setvar "attdia" 0) 
    	(setq meattval "x")
    	(command "insert" "myblock_with_attribute" "s" "1" "r" "0" pause meattval )
    	(setvar "clayer" melay)
    	(if (> PropOnOff 0)(command-s "properties"))
    	(setvar "attdia" 1)
    )
    Last edited by Tom Beauford; 2019-10-29 at 09:15 PM. Reason: Closed Properties

Similar Threads

  1. 2016: lisp layer properties filter current on ALL instead of xref
    By cad2018 in forum AutoCAD General
    Replies: 3
    Last Post: 2017-09-22, 11:07 AM
  2. attributes not showing in Properties palette
    By feargt in forum AutoCAD General
    Replies: 12
    Last Post: 2012-04-17, 05:05 PM
  3. Layer filter for currently selected objects in layer properties palette
    By autocad.wishlist1734 in forum AutoCAD Wish List
    Replies: 0
    Last Post: 2010-06-09, 01:16 PM
  4. interface problem after problem after problem
    By whatisrice in forum ACA General
    Replies: 1
    Last Post: 2009-08-12, 05:06 PM
  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
  •