

NET doesn't generate aġ40 // thumbnail in the resultant file (or its Database)ġ43 // db.SaveAs(dwgPath, false, DwgVersion.Current, null) ġ46 // AcadDocument adoc = (AcadDocument)doc.AcadDocument ġ47 // adoc.SaveAs(dwgPath, AcSaveAsType.acNative, null) ġ49 // So we'll send commands to the command-lineġ50 // We'll use LISP, to avoid having to set FILEDIA to 0ġ52 object ocmd = Application.GetSystemVariable( "CMDECHO" ) ġ53 string dwgPath2 = dwgPath.Replace(pthSep, lspSep) ġ54 string scrPath2 = scrPath.Replace(pthSep, lspSep) ġ58 "(command \"_.SAVEAS\" \"\" \"" + dwgPath2 + "\")" ġ60 "(setvar \"CMDECHO\" " + ocmd.ToString() + ")" +ġ61 "(tp-create \"" + name + "\" \"" + scrPath2 + "\")" +ġ67 doc.SendStringToExecute(cmd, false, false, false ) ġ71 doc.SendStringToExecute(c1+ " ", false, false, false ) ġ72 doc.SendStringToExecute(c2, false, false, false ) ġ75 // Print a confirmation message for the DWG saveġ76 // (which actually gets displayed before the queuedġ79 ed.WriteMessage( "\nSaved to: \"" + dwgPath + "\"" ) ġ85 // Our LISP-registered continuation function to create aġ89 public ResultBuffer CreateToolPaletteCommand(ġ96 Ģ01 ed.WriteMessage( "\nError: too few arguments." ) Ģ05 // We're only interested in the first two argumentsĢ11 "\nError: wrong number of arguments."Ģ16 // First argument is the name, second is the pathĢ19 TypedValue tv1 = (TypedValue)args.GetValue(0) Ģ20 TypedValue tv2 = (TypedValue)args.GetValue(1) Ģ22 if (tv1 != null & tv1.TypeCode = RTSTR &Ģ23 tv2 != null & tv2.TypeCode = RTSTR)Ģ25 string name = Convert. Once you have your Tool Palette setup you can re-use your most common objects in various projects.1 using Ģ using ĥ using ġ4 // Set up static variable for the path to our folderġ5 // of drawings, as well as the base filename and aġ6 // counter to make the unique filenameĢ2 // Various filename and path-related constantsĤ0 Ĥ8 // Ask the user for a base file locationĥ2 "Select location to save first drawing file"ĥ4 opts.Filter = "Drawing (*.dwg)|*.dwg" ĥ9 // (may be a problem if the file is in use)ħ2 // If a file was selected, and it contains a path.ħ6 // Separate the path from the file nameħ8 int idx = pr.StringResult.LastIndexOf(pthSep) Ĩ4 // If the path has an extension (this should alwaysĨ5 // be the case), extract the base file nameĩ5 // Create folders for our icons and our scriptsġ08 // Assuming the path and name were set appropriately.ġ14 // Add our suffix if not the first time runġ19 // Our drawing is located in the base pathġ21 string dwgPath = _path + pthSep + name + dwgExt ġ23 // While our script is in a sub-folderġ26 _path + pthSep + scrLoc + pthSep + name + scrExt ġ28 // Create a dummy script, so we can make sure we pickġ29 // up the contents in our dummy execute commandġ33 "This is a dummy script for " + name + "."ġ36 // Now we want to save our drawing and use the imageġ39 // Using either COM or. After this you need to SAVE the drawing before dragging the block onto the tool palette or else it won’t work for you. Once you select new palette rename accordingly. To create your own folder within the tool palettes menu right click on anyone of the Tabs and select “New Palette”. To get the Tool Palette menu up on your AutoCAD screen hold down CTRL and press the number 3. Step 3: Creating a Folder on the Tool Palette and placing blocks in the folder The next stage is to choose a location where the WBlock will be saved/stored, to do this you will need to select the button and choose a location where you want all your WBlocks saved.

Once you select the Block Function and then click the Drop-down you should then see the Block you have just created.

To do this you type “WBlock” into the command prompt and select enter. Once you have created the block you then need to create a WBlock of the block which you have just created. Finally, you will then need to select what lines will be apart of the block i.e. the point where you can select the object and move it. The base point on the object then be specified on the object i.e. The block must be given a “Name” which best describes the object. Once this is selected you will see a window pop up on your screen. To this you must first go to the “Insert Tab” and selecting the “Create Block” command. The first step you must take is to convert the object into a block. Please see below how you can create and customise your own Tool Palette. Instead if you create it once and place it onto a Tool Palette you can then select it much easier. This function really applies when using the same objects repeatedly and you must keep copying them from one project to another or from one area into another. Using the tool palettes inside in AutoCAD is often a function that is overlooked when using AutoCAD.
