I've been working on converting a VBA macro to an Add-In (my first). I thought all was going well, but I'm struggling to share the InventorApplication object within my add-in...
All the googling I've done suggests the most suitable way is to declare it as a global variable. So I followed the work flow on this page:
([URL]......) and created a module to declare my global variables. I've then referenced this module back in the original class, but when I do, I get a message saying "modDeclarations is a type and cannot be used as an expression"..
I have written code to allow me to pick the dimensions of a part and update the dimension parameter name from a list of choices presented in a form e.g. length, width, thickness, outer_diameter, wall etc.
The parameters are exported and I can get overall sizes in the BOM with relevant expressions in columns. So far so good.
What I would like to do is have a global SIZE column in the BOM which has expressions that vary based on another custom iproperty (PartType) which defines the part. So for example if the PartType was 'circular plate' the expression in that parts row of the SIZE column would be <outer_diameter>x<Thickness> while if the PartType was 'tube' the expression in the that parts row would be <Outer Diameter>x<Wall>x<Length> etc
If I could do this I would not need different columns to define the sizes of every different type of material we use and also limit the number of parameters the user needs to choose from when picking part dimensions.
However looking at the BOM API I do not see an obvious way to alter the expressions.
Can Dynamic Simulation drive multiple variables with a single parameter? In the following example, the variables len_A and len_B are driven by size. The parameter "size" varies from .8 to 1.2 (currently I have size parameters in a Multi-Value List).
Is there a way Dynamic Simulation can drive the "size" parameter to animate the assembly? I plan to use Dynamic Simulation's Output Grapher to Plot a Trace of the triangle's apex as A and B vary in length. The example assembly is attached.
I am new to Inventor API, but have some experiences in SolidWorks API.
How can I select an entity at a given spacial point (x, y, z)? For example, I want to select a face or edge that is on a given (x, y, z) point. I can not find such an API, except for interactive selections.
So 2011 had some issue and I though 2012 would get those fixed. I was wrong. More problems occur. With 2011 I was able to open assemblies directly through vault. Now with 2012, since the vault issue updates as it opens, I crash on any sizeable model or assembly. So now just to open a file, I must get it, then go to inventor and open it, and hit no when the refresh window come up. If I hit yes, it crashes. If I hit no it open, then if i hit local/global update it crashes. So technically I cant do any new work with any of my larger assemblies (2000+ parts) I have sent out numerous error reposrt, only for autodesk to say that they can replicate the problem. I have SP1 installed, and this is happening with other users at my company as well.
System:
Windows 7 64 Bit Solid State HD 24GB RAM Xenon Processor Nvidia Quadro FX 580
I would like to instantly launch an External Rule just by clicking on a button in the Global Forms area of the iLogic browser. Is this possible, and if so, how would I do it?
Product Design Suite Ultimate 2014 | Vault Basic 2014 (SP1) Dell Precision M6600 | Intel i7-2820QM - 16GB nVIDIA Quadro 4000M | Windows 7/64 Pro
Am I able to access and read and write to the file holding the variables used in the parameters-manager's palette. Ideally, I want to read the value held for an action-parameter, do some math using C, and write the result back to the file as a user-parameter which may be seen in the parameters-manager's palette.
Using ACAD2014LT. I want to use the first variable attribute value as a variable in subsequent attributes in the same block. This will be extracted and used for tag references in a PLC program.
Along the line, i know I can change the enclosed character ( ' ), but can I remove it?
if I'm able to save some variables into current DWG?I would like to provide availability for user to save some data which is different for each DWG file.
I was wondering if there is any way to dump out all system variables with current value in a text file. One way would be to have the variable names already preset in a list of strings then extract them. But is there any other faster way? I need to compare some drawings side by side.
I have several variables I want to be able to set and then use throughout my project.
First, and seems simplest, would be to just Public Shared the variables. Set them as required, call them when needed.
Second would be to create an object and assign the variables as properties to that object. It would take more programming to do this option. The beauty of this would be that I could store the values from drawing session to drawing session and would not have to ask the user for the values every time he starts my program. Can this be a custom dictionary object? Is that how you would design it?
Unless there is a way to make my Public Shared variables hold their values when the drawing is closed. Static doesn't seem to work here, but I could be missing something.
when using baseview / viewbase how can I make the resulting views linetypes, weights and colors what I want by default. Currently I change them after creating the views.
Using the VB.NET example code on exchange.autodesk.com for Defining a User Coordinate System, I pretty much copy and pasted the code to suit my needs. While the example shows how to create a UCS origin, X Axis and Y Axis from scratch, I am attempting to simply cast the values from the system variables UCSORG, UCSXDIR and UCSYDIR. These system variables are read only, and when looking into the types, I believe they are all 3D Point type values.
I'm experiencing errors when trying to run the following code, and it's making me wonder whether what I'm attempting to do is possible. The JIT Debugger is pointing out a System.InvalidCastException. Is there a problem with setting a Point3D value (from the system variable) to a Vector3D type (which is required for defining a new ucs)?
Public Sub saveCurrentUcs() 'get the current document and database Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument Dim acCurDb As Database = acDoc.Database
I define a user Variables in autocad2010(such as variableaa=10),I want to use the variable to drive the dimension of a line。
Now I want to change the value of variableaa through .net API,can you tell me how to change the value of variableaa through .net API? can you tell me the code?
I want to change the value of user1 through .net API(user1 is a User Variables),my purpose is to change the length of the line.could you tell me the code?
Why the system variable is valuable to you if you can. CTAB - Useful in FIELD with Layouts for titleblock sheet numbering.OFFSETGAPTYPE - Multiple offset settings.
How do I pull up the system variables dialog box? (also is it considered a dialog box?)
I've always changed individual variables at the command line and in all honesty I didn't even know there was a Dialog box for them until I saw a picture of one on a post here.
How to get a list of commands and variables in AutoCad 2013. In the past I always got that from the help files, but it seems now that I cannot find in the help files in this new version of AutoCad 2013.
We have six CAD machines in our office (not including several versions of LT), and only one machine "AutoCAD 2013" is having this issue:
ATTREQ & ATTMODE keep changing to undesirable values.
We generally use "ATTREQ 0" and "ATTMODE 1" and NEVER change these except "ATTREQ" gets changed in some LISP routines depending on the insert, but "ATTMODE" had to be looked up because we never change it from 1.
I know that there is no reference to ATTMODE anywhere in our customizations.
Does AutoCAD try to manage these system variables? Is there anything else that I can check to stop this?
While in my AutoCad drawing, I need to be able to select cells in an Excel database and use them as variables to create a drawing. I've looked on the Internet and have found some bits and pieces of code for particular uses, but what I'm looking for is the methodology, or some training/examples on working with Excel and AutoCad using VB.net.
I have a few dozen variables that I am trying to store for use at the command line. I can only append to input area with the actual quickcalc open, how i can reinitialize the global variable list?
Just a quick query about Dynamic Blocks. I use dynamic blocks with various visibility states regularly in my drawings. Is it possible to add some kind of custom variable or value to a dynamic block so that I can identify them in automated scheduling?
For example, if I have a dynamic block which represents three variations of very similar machine models is it possible to somehow give each visibility state a value, ie: the model numbers. M100/M125/M150 etc which can then be extrapolated depending which visibility state is active?
Also regarding the limitations of dynamic blocks. Is there a number of visibility states I should not exceed so that the blocks still perform 100%?
When I create a new dwg, I use a macro to set all the system variables in the drawing - ltscale, hatch scale, etc. I also use the setq function and define a few new "variables" in the drawing. For instance I use setq to define a variable I call "sf" and set it equal to 72. Everything works great and I do my work and close the drawing. Next time I open the drawing, all my custom variables no longer exist. I have to use redefine them all over again. Is there a way to get these custom variables that I create with setq to stick with the drawing permanently - so I do not have to redefine them every time I close/open the drawing?