AutoCAD .NET :: Create New DWG From Template File (DWT) And Save
Jul 14, 2011
Current development env: AutoCAD 2012, VS 2010, ObjectARX.Net (2012)
My target: in AutoCAD pops a dialog, select filename (related to our internal projects) string, then it will create a DWG file from a template DWT file. Then some operation like insert elements into the DWG file and then SAVE (with the filename assigned).
Here is the code I currently implemented:
class DWGWritter
{
const string TemplateFile = @"C: empMyTemplate.dwt";
[Code]....
Well it doesn't work on either of #1-4
#1 give out "eFileInternalErr" exception, which I found the answer - you can't call save() if it's open from exist file
#2 works ... but it just save the contents we write to the database but won't save template file contents, ie. we have put in layers inside the template file but they doesn't save to the new file
#3 give out "drawing is busy" error, no clue why it's "busy" ...
I'm plodding along with my template at work when time allows! I have just saved an initial copy as a dwt file. When I open it none of the layers I made are saved except the ones used. How do you save a layer to a dwt template file, as I need the same colors / line weights each time.
Also when I open my dwt file I have the tabs -
model, layout 1, layout 2, A2
I just want the model and A2 tab, so why do the others open as I have not made them. I have attached a dwg of the initial template for your reference.
I am trying to create a single layout with title blockandviewport to save as a template for future. Right clicking on the layout tab does not produce the menu.
I create a new layout by selecting page set up manager in the file menu, create a new layout, but the tab does not show up at the bottom.
I have been tasked with trying to create some type of template (or multiple templates, if needed) to convert my coordinates (some having straight lines and some having arcs) into a script file. I will be gathering the coordinates from an excel file then linking them to my script file.
My problem is, I have hundreds of sets of coordinates (all with varying arcs and straight lines and varying order in which arcs and lines are used) in which I'm trying to establish a method to convert to a script file. Also, the total number of lines (arcs and straight) vary. Some have as little as 10 lines and some contain as many as 20 lines total.
I have successfully created a script file using one set of coordinates but can't imagine doing this hundreds of times over. I have attached a PDF file showing an example of the coordinates along with the radii (in some cases there is no radius, therefore must be a straight line) and how I can accomplish this without creating a script file for each and every set of coordinates I have. The example I have is only a small portion of what I am working with.
Whenever I try to open a new blank file in it, it gives me an error message saying I don't have a "default template", and I needed to choose a file and save it as a "default template". So I did, but now, I'm stuck with that template - I can't choose a letter-sized blank page to work on because that choice is no longer on the list under "New". What the heck is going on? I just want a blank page to draw on, and now it's not available.
I have re-installed APDS Ultimate 2013 onto a new computer and am having some issues setting up my styles and etc...for the most part I have been working on it as I go with no issues...but I can't remember how I set up my export to dxf settings before. I think I just used the default settings, I exported to dxf from the idw environment by saving copy as and selecting dxf from drop down menu and selecting something like AutoCAD 2004. This has worked before and still does now, but the problem is the dxf's that are exported are huge. The drawing is of a single tiny part with basic geometry. The picture below shows the size difference between the files.
how I can make it a normal size, I don't really care about the size of the dxf except for the fact that I can't email it because we have a limit of 10MB.
When I try to create a Save As TIFF file, although TIFF shows in the Format line, what is created is a pbm file. It does it every time. Is there some way for me to create a TIFF file using Save As?
Trying to streamline some work flow issues and would love to be able to "Save As" without having to navigate through file formats , say, .png - every time.
Is there a way to open the file browser in PS to a specific file format each time?
I can't open a new Illustrator file. It sends me this error: Can't create a new illustration. Problems occurred while saving the print file.I opened a previous document created in CC, but it will not allow me to copy and paste items from one doc to another. I have rebooted with no avail.
I'm trying to automate the drawing-creation in our company. Steps I've taken:
- create new drawingdocument with template - Save new drawingdocument
Problem: Creation of new document works, but the next step, saving it to a specific location, fails. Error handler is initiated and displays error: Invalid procedure call or argument.
Used
Dim DXF_DWG as DrawingDocument'Create new drawing based on templateSet DXF_DWG = ThisApplication.Documents.Add(DocumentTypeEnum.kDrawingDocumentObject, ThisApplication.FileOptions.TemplatesPath & "Folded and Flatpattern DXF.dwg", True) 'Save new drawing to specific locationCall DXF_DWG.SaveAs("C:TempTest.dwg", False)
As told, the VB-code raises an error on the last command. What am I doing wrong? What are the correct steps in VBA to create a new drawing document based on a template and save the newly created drawing to a desired location?
I have changed my template using the styles library. For some reason Inventor 2013 will not let me save my new settings as a default in my newly created template. Instead it gives me an error message that reads:
" The following style definitions in template ....... differ from the definitions in the style library; the style library will be used.
Part listart list (ANSI), Revision Table: Revision Table (ANSI)
If the style definitions in the style library are intended for the new document, update the template with the new style definitions. If the style definition in the template are intended for the new document, remove these styles from your style library using the Style Library Manager."
How can you use a template file from your personal files to use it in an already existing .dwg file.
I knwo how to do it if I start the drawing from scratch and I select that template, but I want to put this existing drawing into my personal template file from my documents.
I'm linking an excel file to an .ipt file with iLogic code determining if the Material type is a certian value it will find the correct material thickness. These file work great when working on them thru Vault but when I "Save As Template" and create this file where our other template files are located (not Vault) this fuction does not work. I have realized that I had to place the a copy of the excel file in the same file folder as the template ipt, but even this does not fix the issue.
I recieve this error:
Error in rule: Material, in document: Part6
'MWW Materials (Inventor).xlsx' could not be found. Check the spelling of the file name, and verify that the file location is correct.
If you are trying to open the file from your list of most recently used files, make sure that the file has not been renamed, moved, or deleted.
It seems completly countintutive that just saving the file as a template file would cause this not to work when all files that are required are located in the same file folder. Maybe I need a reference to the excel document within the iLogic code.
I designed these pipes that intersect each other in AutoCAD but that program doesn't seem to do much else other than drafting.
I want to open a pipe design so i can print it out, paste it on a real pipe and cut the end out. It's pretty much sheet metal development.
Attached is one of the many pipes. I have Autodesk Inventor FUSION 2013. Does that have any such features or do I have to get the Professional version?
I would like to utilise the Layout Element: Reference System to draw the grid lines and grid values on paper space viewports.
But.I am working in South Africa. The WGS Lo systems are opposite to the northern hemisphere, positive is heading south not north. To solve this, most drawing offices (including ours) just reverse the signs of X and Y values.
Now you can see why I cannot use the Layout Element Reference System templates provided with Map. I need to change sign the X and Y text values.
How do I create a Reference System Template?
These are provided with Map:
Latitude-Longitude
Military Grid Reference System
United States National Grid
Custom map coordinate system
I tried to use 'Custom map coordinate system' but it is a fixed template, it does not provide change sign as needed.
I was wondering if a template used to create frames using the create frame tool in autocad civil 3D should have the same datum, projection as the files that are being referenced? Or is the template independent from from the reference files and does not need any datum, projection setting applied to it?
I have been tasked with trying to create some type of template (or multiple templates, if needed) to convert my coordinates (some having straight lines and some having arcs) into a script file. I will be gathering the coordinates from an excel file then linking them to my script file.
My problem is, I have hundreds of sets of coordinates (all with varying arcs and straight lines and varying order in which arcs and lines are used) in which I'm trying to establish a method to convert to a script file. Also, the total number of lines (arcs and straight) vary. Some have as little as 10 lines and some contain as many as 20 lines total.
I have successfully created a script file using one set of coordinates but can't imagine doing this hundreds of times over. I have attached a PDF file showing an example of the coordinates along with the radii (in some cases there is no radius, therefore must be a straight line) and how I can accomplish this without creating a script file for each and every set of coordinates I have. The example I have is only a small portion of what I am working with.
Here's something that should be simple, I want to create a template for cutting a square hole 125 mm on a side.
I have gone into Drawing Utilities and set the units to millimeters. I drew a square 125 units on a side.
In paper space, I selected a template that is 11" X 17". I set the scale to 1:1. I thought that that would give me a sheet I could print out ledger size with a 125mm square drawn on it, but no, it is not even close. As near as I can figure, the square is 125" on a side in paper space.
Just updated to CC and now when I try to save over old templates it gives me an error message saying it cannot save because this template may be in use in another program...but the only program its in use in is illustrator at that moment because im making changes to it.
I use VS Pro X4 Ultimate with SP1 on a new installed Windows 7 Pro 64bit system. I try to create a BD menu with submenu, but I can't save my changes in the submenu. I understand from a other topic, that I must use a template and save these changes under my Favourites Gallery. I do the steps like in the topic below, but I never get button “Add to menu template” to save it. Where is this button?
"By Customize you are changing the template, after which the “Add to menu template” will become available, now you can save the template, which will show in the Favourites gallery.
1 / First page, choose a template
2 / The screen shows the Main Menu (the Title Menu) as “Currently Displayed Menu”
3 / Double click the text on screen to change to your own.
4 / If you have created “Chapters” choose the drop-down box Main Menu and change to Untitled
5 / You are now viewing the Chapter Menu
6 / again double click the text to modify / change
7 / Selecting the Edit Tab will allow you to add background music and video/images.
Then customise the font types, size and colour etc.You can customise the Motion Menu and also select other Buttons.Again once "customised" you can save the template to the Favourites Gallery"
Any way to use iLogic to create custom iProperties from the cells in an Excel spreadsheet (both text and numbers) for a .dwg template. The only thing even close has been a user who already knew how to do it and was having a different problem. I am using Inventor 2012 and Excel 2003 and have very little experience with VB. I currently have a family of assemblies, consisting of two parts linked to an Excel spreadsheet to control the various parameters for each variation of the assembly.
I need creating an iLogic rule that will:
Go to a specific tab (I have four different tabs/worksheets) in an Excel spreadsheet.
Make a specfic row of that worksheet the current row based on the part number used to generate the models of the assembly shown in a .dwg.
Use the contents of a cell in that row (text or numeric or a combination of both) to generate a custom iProperty for the .dwg template.
Use the custom iProperties to fill in the title block of the template.
I have a working document, part of which should become a template for similar docs.
However the part that should become a template is not all that is in the document.
I guess I can turn off the eyeball of all layers or objects not meant to be part of the template but then the template will have all the extra junk in it (turned off).
Is there a better way than saving a copy of the doc, opening it and deleting all that is not meant to be template, then resave as template?