+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Forum Newbie
    Discipline
    Mechanical
    Using
    Mechanical 2018
    Join Date
    Sep 2017
    Posts
    2

    Default change visibility states using a field

    Registered forum members do not see this ad.

    Hello all,
    I have posted as a reply on other post to try and find a way to make what seems to be impossible...possible...First and foremost...I KNOW THE EXACT EQUIVALENT OF SQUAT!! about writing, reading, or understanding LISP or the verbiage associated with it. That being said, I would like to know in the most simplistic of terms, how to change the visibility state of a dynamic block using a field that is referenced from an Excel sheet. Here are the steps that I would like to take in order for what I want to accomplish to happen:
    open excel file
    input visibility state data for the block in a designated cell
    save the excel file
    open the AutoCAD dwg
    print (and have the block associated with the Excel input displaying the correct visibility state)
    I have attached a very simple block and excel sheet with this message, in the excel sheet I have copied the block information from the various visibility states using the LIST command in AutoCAD. I am currently using AutoCAD Mechanical 2018, but this block was made in AutoCAD Mechanical 2016.

    Here is a code that I copied from a very knowledgeable resource on LISP routines, Mr. Lee Mac, which I am sure that most of you have heard of.

    ;; Set Dynamic Block Visibility State - Lee Mac
    ;; Sets the Visibility Parameter of a Dynamic Block (if present) to a specific value (if allowed)
    ;; blk - [vla] VLA Dynamic Block Reference object
    ;; val - [str] Visibility State Parameter value
    ;; Returns: [str] New value of Visibility Parameter, else nil
    (defun LM:SetVisibilityState ( blk val / vis )
    (if
    (and
    (setq vis (LM:getvisibilityparametername blk))
    (member (strcase val) (mapcar 'strcase (LM:getdynpropallowedvalues blk vis)))
    )
    (LM:setdynpropvalue blk vis val)
    )
    )

    My problem is the utterly embarrassing lack of knowledge when it comes to LISP code, so I have absolutely NO idea as to how to utilize or implement his program, what variables to change to fit my drawing or how to make it reference the field or Excel sheet. So any help would be greatly appreciated, and please, feel free to assume that you are talking to a complete idiot on the subject of LISP, because you are, and feel free to explain even OVER explain in detail the changes that I need to make in order to make this little bit of happiness work for me. Thank you in advance for all of those that have taken the time to read this, and have input to share.

    Thank you,

    Jetxcc

  2. #2
    Forum Newbie
    Discipline
    Mechanical
    Using
    Mechanical 2018
    Join Date
    Sep 2017
    Posts
    2

    Default Excel & AutoCAD dwg

    Registered forum members do not see this ad.

    here are the files that i forgot to attach to the last post.
    Attached Files

Similar Threads

  1. Multiple Visibility states and change text header via Lookup
    By asouf in forum AutoCAD Drawing Management & Output
    Replies: 0
    Last Post: 3rd Nov 2016, 04:47 pm
  2. Visibility States
    By eyde in forum AutoCAD Drawing Management & Output
    Replies: 0
    Last Post: 7th Nov 2011, 10:08 pm
  3. Can Attribute Values Change Visibility States
    By Alaskachick in forum AutoCAD 2D Drafting, Object Properties & Interface
    Replies: 4
    Last Post: 3rd Jun 2011, 06:03 pm
  4. visibility states
    By mnewton in forum AutoCAD Drawing Management & Output
    Replies: 3
    Last Post: 11th May 2011, 06:59 pm
  5. Visibility States
    By chelsea1307 in forum AutoCAD Drawing Management & Output
    Replies: 1
    Last Post: 2nd Jun 2010, 09:52 pm

Tags for this Thread

Bookmarks

Posting Permissions

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