Jump to content
jetxcc

change visibility states using a field

Recommended Posts

jetxcc

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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...