Author Topic: Block Custom User Parameter  (Read 672 times)

0 Members and 2 Guests are viewing this topic.

Chris

  • Swamp Rat
  • Posts: 544
Block Custom User Parameter
« on: July 25, 2019, 12:59:30 PM »
I'm not having much luck finding anything on the subject, perhaps it is the search terms I am trying to search for.
Here is my situation.
I have a library of 500 sign blocks that I want to add custom user parameters to.  These parameters are then used to fill in an attribute that labels the quantities of the sign.
The current process would be, block edit
open the parameters manager, create new user parameters, then move on to the next one.

In my mind I would think there should be some way to add them via LISP.  Although anything I have found doesnt seem to work the way I'm expecting it to.  Things seem to run, but nothing seems to work.  I know that no matter what method I use, I will have to do some manual cleanup with the sizes for the various signs, but I figure if I can get as much of the process automated as possible, the quicker the process would go.
These are the parameters I'm trying to add:
SignBaseHeightFt with a value of 5  Show
SignHeightIn with a value of the sign height default 30  Show
SignWidthIn with a value of the sign width default 30  Show
SignPosts with a value of ceil(SignWidthIn/35.99) No Show
SignArea with a value of (SignHeightIn*SignWidthIn)/144 No Show
SignPostLength with a value of (SignHeightIn/12+3.5+SignBaseHeightFt)*SignPosts No Show

Any guidance that can be provided would be appreciated.
Christopher T. Cowgill, P.E.
AEC Collection 2018 (C3D)
Win 10

CAB

  • Global Moderator
  • Seagull
  • Posts: 10369
I've reached the age where the happy hour is a nap. ()
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Chris

  • Swamp Rat
  • Posts: 544
Re: Block Custom User Parameter
« Reply #2 on: July 25, 2019, 01:33:13 PM »
Thanks, but it isnt an attribute that I'm looking to add. I have that portion, it is the custom user Parameter.
Christopher T. Cowgill, P.E.
AEC Collection 2018 (C3D)
Win 10

Dlanor

  • Newt
  • Posts: 183
Re: Block Custom User Parameter
« Reply #3 on: July 25, 2019, 04:09:31 PM »
Do they show up when you use the getdynamicblockproperties method.

See Lee's page http://www.lee-mac.com/dynamicblockfunctions.html

Chris

  • Swamp Rat
  • Posts: 544
Re: Block Custom User Parameter
« Reply #4 on: July 25, 2019, 07:33:40 PM »
Existing ones do that were created manually, I however do not seem to be able to create new ones.
*edit1*
I may however be able to use some of Lee's other functions, trying a few of them right now.
*edit2*
Even trying other functions, I'm still not having any luck.  He doesnt have one that specifically says Add Block Property.  The two similar functions, seem to only work for adding a value to a preexisting property.
« Last Edit: July 26, 2019, 07:43:10 AM by Chris »
Christopher T. Cowgill, P.E.
AEC Collection 2018 (C3D)
Win 10

Lee Mac

  • Seagull
  • Posts: 12295
  • London, England
Re: Block Custom User Parameter
« Reply #5 on: July 26, 2019, 12:14:23 PM »
Per the answer I posted here, the ability to create new dynamic block parameters was never exposed to the LISP API.

Chris

  • Swamp Rat
  • Posts: 544
Re: Block Custom User Parameter
« Reply #6 on: July 26, 2019, 03:42:03 PM »
Thank you Lee.  Any idea if it is available on the .net api?
Christopher T. Cowgill, P.E.
AEC Collection 2018 (C3D)
Win 10

Lee Mac

  • Seagull
  • Posts: 12295
  • London, England
Re: Block Custom User Parameter
« Reply #7 on: July 26, 2019, 06:19:35 PM »
Thank you Lee.  Any idea if it is available on the .net api?

Mostly likely, but this isn't my area of expertise - you'll need to ask one of the .NET guys  :-)

Chris

  • Swamp Rat
  • Posts: 544
Re: Block Custom User Parameter
« Reply #8 on: August 28, 2019, 02:17:49 PM »
Checked with some .net guys, it appears that Autodesk thought it would be best not to expose this API to anyone.
On a related question.  I've since moved on and decided to insert my block into my drawing with the dynamic properties already present.  Saved a ton of time. 
Now I'm trying to get through the next phase, with a faster way to update the values than physically opening the Parameters Manager. 
I figured that I would prompt the user to input the width and height parameters at the command line, then push those values into the corresponding user parameter.
When opening the drawing, I get the prompt to open in the block editor.  I answer yes, from here I'm in the block editor and can manually open the parameters manager.  Trying to automate changing the values, because there is no block, the dynamic block functions dont seem to help because I cannot actually select the block, because the whole drawing I'm working in is the block.
Any thoughts?
Christopher T. Cowgill, P.E.
AEC Collection 2018 (C3D)
Win 10

Lee Mac

  • Seagull
  • Posts: 12295
  • London, England
Re: Block Custom User Parameter
« Reply #9 on: August 28, 2019, 04:52:42 PM »
Now I'm trying to get through the next phase, with a faster way to update the values than physically opening the Parameters Manager.  I figured that I would prompt the user to input the width and height parameters at the command line, then push those values into the corresponding user parameter.
When opening the drawing, I get the prompt to open in the block editor.  I answer yes, from here I'm in the block editor and can manually open the parameters manager.  Trying to automate changing the values, because there is no block, the dynamic block functions dont seem to help because I cannot actually select the block, because the whole drawing I'm working in is the block.
Any thoughts?

Surely the parameters should be populated upon inserting a reference of the dynamic block - why are you opening the dynamic block definition?

Chris

  • Swamp Rat
  • Posts: 544
Re: Block Custom User Parameter
« Reply #10 on: August 28, 2019, 05:11:43 PM »
I'm trying to set the default value for those parameters so that in theory, unless we are using a non standard value, they already have the proper value.  I've got 500ish blocks that I started with a base block that contained values for the parameters, so now I need to go through and update them to the correct value.
Christopher T. Cowgill, P.E.
AEC Collection 2018 (C3D)
Win 10