Using parametric blocks in a drawing

Hi,

New to cad, so please try to understand if I don't use the right terms.

I made a simple parametric drawing of one of our standard products, which vary in several ways.

  1. Do I have to save this drawing in a certain way to be able to import it in another drawing? Do we call that a block?
  2. Once imported, I want to change length, width, radius 1, radius 2, hole diameters, hole count etc. But I want to create several different results. Can you make every imported one unique, while retaining the parametric editabilty?

Comments

  • Hi Arno,

    I don't know about 3D Constraints, but in 2d....

    If you insert your parametric drawing (into another drawing) using BMINSERT, then you can bring it in as many times as you like and alter each one individually.

    Try not to explode them as things can get a bit messy on screen unless you want to alter something outside the scope of the constraints, in which case make sure you "delete 2d constraints" on the selected item so you can edit it.

    You don't necessarily need to save it in any particular place but it is a good idea to keep them all together.

    I think you can use the Library to set up all your parametric blocks into sensible categories.

    Hope that helps.

  • Agree save as a single dwg simpler to maintain. You can via lisp change the values in the dynamic block so create a front end, an example. This is a library function can have as many inputs as required and image to suit, happy to post. You need to get a copy of Lee-mac.com dynamic block lisp.

  • Thank you both sofar.

    BMINSERT works!
    Delete 2d constraints doesn't seem to work just yet. Keeps asking 'select entities to delete all constraints'.

    I'd like to use blocks as following:

    • Insert them in a drawing of a project
    • Edit them separately to fit the project
    • Convert the blocks to polylines
    • Assign the polylines to several layers for cnc-routing. For instance: the outline is layer 1, the cutouts layer 2, the holes layer 3.

    I added my first experiment for you to look at if interested. It might be full of errors.

    I should get some schooling probably, but for now I'm afraid I'll have to do with the internet.

  • ALANH
    edited May 2021

    Happy to show how to do a dcl front end for you uses a library function. I dont do much with dynamic blocks but something wrong.

  • @David Waight said:
    Hi Arno,

    >

    Try not to explode them as things can get a bit messy on screen unless you want to alter something outside the scope of the constraints, in which case make sure you "delete 2d constraints" on the selected item so you can edit it.

    I finally managed to delete the constraints of a bminsert-ed block.
    First I explode the block, the parameters show up as 'annotations'. Then I can use delconstraint to delete the parameters. Not sure if this is the quickest method, but atleast it works for now.
    I only want to use this method if a part has to be modified beyond what the formulas allow.

  • Hi Arno,

    Glad you are making progress, I haven't had time to look too deeply in to your parametric block, but the one you uploaded was all on the same layer, so obviously that needs addressing.
    You are correct that you need to explode more than once as you have a dynamic array as well as a parametric block.
    I wrote my one and only lisp routine to explode and delete constraints all in one go to circumvent all the constraints appearing and then having to delete them.
    It isn't pretty as drawing is my thing not programming :-)

    ; Explode Standards and Delete Constraints
    (defun c:XS ()
    (setq sel1 (ssget))
    (command "_explode" sel1)
    (command "_delconstraint" "P" "")
    (princ)
    )

    You do need to adjust at least one dimensional constraint before you can use it for some reason.

    Hope it helps.

  • Maybe I am a bit late to the party but with parametric blocks I create quite a lot of them and when I insert a block i just then copy it and if I like I can change each one and have them different without exploding the blocks when to write a parametric block you need to set up some parameters (There is no restriction on the amount of these) then if you want to change an individual block through the parameter then this is simple
    EG. I have set up parametric bolts so I insert an M10 bolt and change the parameters for the length of the bolt and the material thickness it is being used on. then if i want the same type of bolt I just copy and paste this and then change the new bolt to the size and material thickness I required.

    It is a simple as that.