Jump to content

set/mod values of block linear parameters from excel


Recommended Posts

Hello to all of you.

 

I have a question regarding custom block properties associated with actions.

I have an action "move" (on the pic is move7) which moves a point object at the top of the arow. The linear parameter "Distance4" measures the horizontal distance from the middle to the point object and visualizes it into pock property X2.

My question is if anyone knows a way to modify the linear parameter values from excel (i ow to import values). Based on the imported values the linear parameter length is changed, point moved to the imported distance and new value displayed in block property X2?

I am pretty sure that this is impossible, but I had to ask.

 

points.png

Link to comment
Share on other sites

If you're willing to do some coding, almost anything is possible. The question here, I'd say, is whether you can find some functionality already in AutoCAD that lets you do what you want.

 

I'm not sure exactly what you want to do, and I don't have much experience with dynamic blocks, but have you tried a lookup table? You would lose the flexibility of the external spreadsheet, but maybe that's okay.

Link to comment
Share on other sites

What you want is definitely possible finished something like this recently. Passes info from Cad to excel does some calcs then inserts and updates a dynamic block in CAD.

 

1st step is get Lee-mac Dynamic Block properties lisp this allows gets and puts of values in a dynamic block.

 

2nd step is a "getcellvalue" using a  program like "getexcel.lsp" 

 

You can do stuff like open the lookup values and choose correct one. Can help with that uses another program to populate a dcl for choice.

 

I would start with the Lee part entering values and your block changing. The excel link can be a bit harder.

 

 excel stuff
(OpenExcel ExcelFile$ SheetName$ Visible)
(setq wid (getcell "E7"))


Lee's
(LM:setdynpropvalue blk "Width" wid)

(setq visval (LM:getvisibilityparametername blk ))
(setq winlst (LM:getdynpropallowedvalues blk visval))

(LM:SetVisibilityState blk ans)

 

Give it a go, if you get stuck ask.

 

 

Edited by BIGAL
Link to comment
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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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...