See the top rated post in this thread. Click here

Results 1 to 2 of 2

Thread: How can I put a block on a tool palette with code?

  1. #1
    Woo! Hoo! my 1st post
    Join Date
    2020-07
    Posts
    1
    Login to Give a bone
    0

    Question How can I put a block on a tool palette with code?

    I really, really need the ability to build tool palettes full of blocks by coding. Yes, I need to do it this way, I have to constantly re-make close to 50 tool palettes every 3 weeks or so. It is an extremely arduous task, and very soon, I will have to make close to ONE HUNDRED tool palettes. No, we can't make them "networked" either, they have to be distributed externally to our customers who use our blocks.



    One of the major driving forces behind this request is we need the ability to mix-and-match blocks from various releases, such as Rev 11-1 of Block #50 at the same time as Rev 10-3 of Block #50 and so on. So the name of the block in the resource dwg may not change...execept for the rev number in that block name. Overall, this may not sound like a good idea, but it is the setup I have to operate in. Reasoning/rationale for it is too much to elaborate on in this initial post, trust me.



    I have done an absolute TON of searching over the last week. I keep finding "put commands" or "put buttons" on a tool palette with code. I MUST have the coding ability to put a BLOCK on a tool palette, and then set Tool Properties with code also.



    I cannot build an XML/write an atc file from scratch to make a tool palette like that, I have tried that, and the code is waaaaay too much to try and decipher/reverse engineer; that is NOT an option.



    Is what I want possible within the API with any officially defined Methods? I myself am not an experience coder, but I have several coworkers who are, so if you have applicable fragements of knowledge, I'm all ears. This would change my whole world unbelievably

  2. #2
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,172
    Login to Give a bone
    1

    Default Re: How can I put a block on a tool palette with code?

    XML is a text based file. Creating the necessary elements are not difficult to create through programming. It is understanding the necessary information that is needed. Building a tool palette programmatically is not the recommended method. I'm not even sure there are methods available as I don't use .NET often.

    I would recommend you take several existing palettes and evaluate the differences. Once you understand the differences, you could develop differing sub-routines to compile a new tool palette. You would have sub-routines to generate the headers/footers of the file and other sub-routines to build the tool sections.

    You could also create snippets of working tools to combine with a new tool palette.

    Each tool in the palette must have a unique GUID along with other required properties.

    There is an associated Catalog (.ATC) file containing links to each tool palette you will need to analyze before getting it all working correctly. It is typically located in the parent folder of the folder containing the tool palette .ATC files.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

Similar Threads

  1. Replies: 0
    Last Post: 2011-10-11, 10:00 AM
  2. Put a script on a tool palette
    By CAD_monkey in forum AutoCAD General
    Replies: 2
    Last Post: 2007-12-04, 08:01 PM
  3. Put sub-assemblies into a Tool Palette or the Custom Tool Catalog?
    By justin.d.ehart in forum AutoCAD Civil 3D - Corridors
    Replies: 1
    Last Post: 2007-06-05, 03:52 PM
  4. Replies: 3
    Last Post: 2006-10-21, 01:03 PM
  5. Replies: 1
    Last Post: 2006-07-14, 10:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •