AutoCAD .NET :: Accessing Variables
Dec 1, 2013
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.
View 2 Replies
ADVERTISEMENT
Aug 7, 2013
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?
View 3 Replies
View Related
Aug 30, 2011
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"..
So here's what I've got:
View 3 Replies
View Related
Sep 12, 2012
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.
View 9 Replies
View Related
Oct 14, 2011
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.
View 6 Replies
View Related
May 3, 2013
reading some variables into DWG file - how? C#.
View 3 Replies
View Related
May 3, 2012
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.
View 3 Replies
View Related
Jun 17, 2013
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.
View 3 Replies
View Related
Dec 12, 2012
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
[Code]....
View 1 Replies
View Related
Jan 30, 2013
Parametric Drawing about .net API。
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?
View 2 Replies
View Related
Feb 20, 2013
this is a screenshot of the dwg-file。
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?
View 2 Replies
View Related
May 17, 2013
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.
View 9 Replies
View Related
Aug 1, 2012
how to get a list of Variables and Commands from the Help file?
View 9 Replies
View Related
Oct 2, 2012
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.
View 4 Replies
View Related
Dec 28, 2012
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.
View 4 Replies
View Related
Oct 2, 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?
View 6 Replies
View Related
Sep 19, 2013
I'm trying to write a plug-in that involves operations with TIN surfaces. I tried to follow the example from the Developer's guide just to see if I could get accessing a TIN surface to work, but without success, and now I'm stumped.
Here's my code, which is supposed prompt the user to pick a surface, and then simply spit out the name of the surface that was selected:
Imports System
Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.Geometry
Imports Autodesk.AutoCAD.EditorInput
[code]....
The plug-in is loading just fine and the initial prompt comes up, but whenever I actually select a surface after being prompted, I get a fatal error that causes AutoCAD to close.
View 3 Replies
View Related
Jul 24, 2012
I am trying to have access to the property Custom scale of the Viewport object and trigger a piece of code as soon as I pick the Viewport and change the zoom / Custom scale property.
View 2 Replies
View Related
Sep 21, 2011
I'm having a problem accessing data manager tables in the 2011 version. My C# .NET code worked fine with 2010. Here is a sample of the 2010 code that works, but returns zero length tables in 2011.
C#
ProjectPartCollection oPP = PlantApplication.CurrentProject.ProjectParts;
PlantProject oPProj = PlantApplication.CurrentProject;
Project oProj = oPP["PnId"];
try
{
//get ACAD data table
[code].......
The last two lines fail to object any meaningful data in 2011. In 2010, I would have all the table rows and could access tags and asset information.
View 2 Replies
View Related
Jul 20, 2011
I have successfully created and defined a topolgy in Map 3D using a Visual Lisp routine that I cobbled together from CREATE.LSP. What I'd really like to do is be able to access that data and create closed polylines and centroids without going through the menu interface. The only documentation that I've been able to find is the Mapping Commands section of the Help file.
I found several commands, but they rely on user input to work. I might be able to work around this by typing a dash before the command line to suppress dialog boxes except for the fact that MAPCLPLINE does not respond to this method.
I noticed in CREATE.LSP that there was a TPM_MTNBUILD command that (apparently) was used to build the topology. Are there similar commands that I just haven't found yet?
View 2 Replies
View Related
Dec 3, 2013
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.
View 3 Replies
View Related
Oct 18, 2013
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?
View 9 Replies
View Related
Aug 3, 2012
Why do most of the VB.Net examples, define and assign a variable in a single line as it is being used in the program.
In VBA I found it easier to read the code with the variables defined at the top of the function or subroutine.
What do most of you do when defining variables ?
I find the VB.net lines below more difficult to read ..............
For Each acSSObj As SelectedObject In acSSet
Dim acEnt As Entity = acTrans.GetObject(acSSObj.ObjectId,OpenMode.ForWrite)
View 3 Replies
View Related
Feb 27, 2013
Is there a list of obsolete commands / variables AutoCAD 2012?
AutoCAD Commands, variables, LISP commands, LISP variables?
View 3 Replies
View Related
Jul 12, 2012
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%?
View 3 Replies
View Related
Jan 29, 2013
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?
View 3 Replies
View Related
Feb 25, 2011
I have developed a handout for my students and graduates I thought I would share here:
[URL]
View 8 Replies
View Related
Oct 6, 2011
I'm setting up some custom toolbars and that's no problem, but what I'd like to do is have one of the buttons be a toggle, so the icon changes depending on what state it is in. I'm just having a bit of trouble figuring out how I find those buttons programatically from within C#. I've included Autodesk.Autocad.Customization which gives me the Toolbar, Tool bar button, etc classes, but I don't know how to find the existing toolbars from the running session of AutoCAD.
View 9 Replies
View Related
Dec 13, 2012
I'm trying to rewrite some old VBA code into VB.net (which I'm not even Novice level yet), and I'm stumped on what would be a fairly simple principle (in VBA)..
For Each BlockDef in ThisDrawing.blocks If Left(BlockDef.name, 12) = "*Paper_Space" then Select Case True Case BlockDef.Layout.Name Like "*Test*" blah blah End Select End IfNext
Essentially conditional manipulation of paperspace elements depending on the layout name.
The following fragment allows me to recurse through entities in paperspace, but I've no idea which layout tab..
Dim BlkPaperSpc As BlockTableRecord = ScanTrans.GetObject(BlkTab _(BlockTableRecord.PaperSpace), OpenMode.ForWrite)For Each AcObjId As ObjectId In BlkPaperSpc Dim PspaceObj As String = AcObjId.ObjectClass.NameNext
What I need to do is to be able to identify a type of object (a table), confirm it's location, delete it and replace it with another one, depending on which layout tab it's on.
ACad, MEP, 3DS Max
Windows 7x64
X5482 @3.2Ghz 8Gb Ram
Quadro FX1700
View 2 Replies
View Related
Jul 18, 2012
I have already a Selection Set called objSS. All the objects in this Set are Multi Text, so I am wondering how is possible to have access to the property Text Height of these objects inside the Set in order to change the value of this property. I have created a variable as AcadMText but is not possible for me to loaded it with any item from objSS.
View 3 Replies
View Related
Mar 3, 2013
I have a problem with our new 2013 Theres a long time delay before the File menu wether you hover over it or click on the file button. Same if you use the Autodesk top left button
All the others act as expected i.e. edit, view, insert etc
This is really causing a loss of productivity through the time delay and extreme frustration waiting for it to click in
View 3 Replies
View Related