6 Replies Latest reply on Dec 2, 2015 8:06 AM by Dan Bertschi

    Drag & Drop Blocks in DraftSight?  Please point me in the right direction...

    Dan Bertschi

      Many moons ago, I started learning SolidWorks and AutoCAD at the same time.  Coming from Computer Vision 4 (d'oh! now you know how old I am...), I chose to concentrate my efforts on SolidWorks & 3D design & never looked back.

       

      I'm currently working for a company that creates drawings, similar to electrical schematics & flow charts, to express a logic system used with safety interlock equipment.  What I hope to accomplish is the following:

       

      1. Create a library of drag & drop blocks (icons) that have connection points. (think Visio).
      2. Create automation tools that might count/itemize the blocks and report a BOM type of chart that would indicate what products are needed to complete the scheme.
      3. Provide these tools (with free DraftSight) to our sales people & customers.
      4. Anything else that might help automate the process & educate our customers.

       

      I'm not expecting anyone to do my work, but I'll take any time saving tips regarding block creation (meta-data use included), what key words to search on, etc.  I'm just looking for a nudge in the right direction, since I've managed to avoid most Autodesk products during my career!  I'm choosing this path, of course, because of the free DraftSight license.  I want to empower our customers with these tools to hopefully increase our market visibility, and increase sales.

       

      Wish me luck & thanks in advance for any responses!

        • Re: Drag & Drop Blocks in DraftSight?  Please point me in the right direction...
          Kevin Chandler

          Hello,

           

          1) Do you need/want text properties to be associated with each block instance?

          Look into attributes (as opposed to adding "regular" text entities). Attributes can be with default values, invisible, non-plotting.

          Plan and add them ahead. Painful to retrofit them.

          Decide on the font, size, etc ahead of time and create a textstyle using these values.

           

          2) You need to understand the differences between BYLAYER and BYBLOCK for layers, linetypes and colors.

          I try to stick with BYLAYER.

           

          3) What layers and linetypes are required?

          Going with BYLAYER for the block with everything on layer 0, then the block with inherit the color and linetype of the layer in the destination drawing.

          If a block (or portion thereof) always needs a specific color, layer or linetype, then that must be set in the block.

          Your client may be driving this one.

           

          4) Try to find some legit blocks premade out in the Inter-wilderness.

          Quality-wise, YMMV.

           

          5) If you want the inserted block to inherit the layer it's on in the drawing, the block's entities must be on layer 0 (zero, it's built-in and non-removable).

          Otherwise, the non-0 entities will be on their own layer with that layer's specifics being applied.

          Block-specific layers, linetypes, colors are added to the destination drawing when the block is inserted.

          (Can't remember for sure if this is accurate: But, if a block-specific layer, linetype, or color is already in the destination drawing (and their definitions differ), the destination file definition rules.)

           

          6) Locate the your block's stuff so that its insertion point is at its 0,0 for easier insertion later.

          MOVE, ALL, ENTER, select point, 0,0, ENTER

           

          There's more but that should getting you started off.

           

          Cheers,

           

          Kevin

           

          Edit:

          With regular DraftSight, you can update blocks and extract their attribute data to a text file.

          But if greater/easier block/attribute functionality is required then you may need to upgrade to DS Pro (which isn't free).

          Also, free DS is programmatically limited. Basically, it can run scripts, which in this context, is a text file listing the commands you would have otherwise typed yourself.

          There's no pausing to collect user input. The script starts and runs to completion or derailment.

          If more flexible programming is required for your situation, then it's back to DS Pro again.

           

          Before you travel too far, it's probably worth investigating the differences between the two to see if the freebee version will suffice for you.

           

          Cheers again.

           

          Kevin

            • Re: Drag & Drop Blocks in DraftSight?  Please point me in the right direction...
              Dan Bertschi

              Thanks for your help, Kevin!

               

              It all sounds great & do-able.  I'll check out DS-Pro, but will most likely try to make it work with regular DS.  I like free stuff, and if we need more advanced techniques, I'll make it happen in SW drawings formats instead of DS, or possibly another solution.

               

              At this point, these are disconnected from our normal product drawings/definition, and will probably remain disconnected for some time.  It would be nice to build a 3D system & report that with a 2D schematic.  Too bad SW Electrical isn't a freebie, or I'd try to customize that! We only have SW-Pro here.

               

              Off I go, to build some blocks!  Thanks again for the tips & info

                • Re: Drag & Drop Blocks in DraftSight?  Please point me in the right direction...
                  Kevin Chandler

                  Hello,

                   

                  You're quite welcome, glad to been of help.

                  If you have further questions, either repost or send me a message and I'll see what I can do.

                   

                  Cheers,

                   

                  Kevin

                    • Re: Drag & Drop Blocks in DraftSight?  Please point me in the right direction...
                      Dan Bertschi

                      Kevin,

                      I've got this figured out pretty well, thanks to your help!  The only question I have is, can I control the order of the attributes I created, AFTER I create them?  I've observed that they present themselves to the user, at insertion, in the order in which they were created.  I also found the edit attribute dialog box by double-clicking the block.

                       

                      If I can't control them, I can delete & recreate the attributes in my desired order. They're actually pretty easy to set-up, once the process is understood.

                      -Dan

                        • Re: Drag & Drop Blocks in DraftSight?  Please point me in the right direction...
                          Kevin Chandler

                          Hello,

                           

                          In AutoCAD (& eventually into AutoCAD  LT also), there was an attribute mod command called BATTMAN (Blaock Attribute Manager) which performed such niceties as what you've collided with.

                           

                          I didn't seen an equivalent in DS, but it could be, I've been doing touch 'n go's at my desk today so I haven't research this too heavily.

                          Check DS help to see if there is an attribute manager type command.

                          I did type "BATTMAN" on the command line to see if the AutoCAD alias was mapped to a DS equal, but DS just said, "Huh?", which makes me suspect there's not an equal command.

                           

                          DS, for the most part, is AutoCAD LT of several vintages ago (especially still using pull-down menus and LT's been on the ribbon for quite awhile), so perhaps it's of the pre-BATTMAN vintage. Dunno.

                           

                          Without BATTMAN, I'd make a copy of the block with out-of-order attributes.

                          Then delete them in the original file.

                          Finally copying & pasting one at a time from the duplicate in the desired order.

                           

                          Like I said originally, painful.

                          Sorry I forgot about this behavior, but it's been awhile since my AutoCAD days. Plus, you try to forget AutoCAD as fast as you can.

                           

                          Also, keep in mind that attributes are unique to each block instance.

                          So, if you figure an existing block needs a new attribute and you've inserted the block into other DWGs already, an update of the block won't add the attribute to existing instances.

                          It will update the block definition in the DWG file, so new instances will be of the latest vintage, but existing ones will need to be deleted and reinserted.

                          This is one of the reasons why I said to first plan ahead.

                           

                          Like I said...attributes are painful.

                           

                          Cheers,

                           

                          Kevin

                            • Re: Drag & Drop Blocks in DraftSight?  Please point me in the right direction...
                              Dan Bertschi

                              Great wrap-up, Kevin.  I agree and confirmed this with an AutoCAD instructor.

                               

                              No problems, I'll just plan ahead when creating them.  I plan to order them from most important to least important, even optional at the end.  That way, the end user can enter data required at the beginning of block insertion, and just hit ENTER if the last attribute items are not needed for that usage case of the block.

                               

                              I'll be making 50+ of these, probably more as customers start using them.  I'm all about adding value, especially if it helps sales

                               

                              See ya in Dallas!