AutoCAD .NET :: Accessing Database Tables
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
ADVERTISEMENT
May 23, 2013
Would you have a solution to accessing ODTables for a dwg object only loaded into memory? I have 1000+ dwgs that I want to return a string with the names of the various ODTable names for auding purposes that I would prefer to just side load rather than full load for performance reasons.
I'm attempting to use something like this (which works fine on an open drawing):
Public Function ReturnOBJData(acObjIDIn As ObjectId, intOffset As Integer) As String
'Don't forget that table is 0 based offset so....plan accordingly Dim strRet As String = ""
Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument
Dim acDb As Database = acDoc.Database Dim acEd As Editor = acDoc.Editor
[Code] .......
In a fashion along the lines of
Public Function GetTables(strFileIn As String) As List(Of String)
Dim lstReturn As New List(Of String)
Dim acMapApp As MapApplication = HostMapApplicationServices.Application
Dim acActiveProject As Project.ProjectModel = acMapApp.ActiveProject
Dim acTableList As Tables = acActiveProject.ODTables Dim acTable As ObjectData.Table
[Code] ....
The problem is that I can't seem to link the ODTables object off of the memory database object. In this sample, the msgbox always returns a count of 0 where I would expect it to be in the range of 1-4.
View 6 Replies
View Related
Dec 6, 2013
Is there a way to search the database/tables/whatever to determine if new layers are present in a drawing?
I want to run a script to reconcile new layers in the sheet drawings after having cleaned the xref drawings, and the script bombs if there are no new layers present in the parent drawing.
If I could determine what triggers the layereval/layernotify sequence (tblsearch?) I could include an if or while lisp routine that would invoke the layer command and then reconcile the new layers.
View 9 Replies
View Related
Sep 15, 2011
MS Access database that can export Family Tables? Or knows of a 3rd party application that all the type information can be houses in a database, and the family table's TXT is just an export. The family tables we create are nemorus, and lengthly family tabels, and Excel just is not cutting the mustard.
Or would Autodesk ever include this in Revit?
View 5 Replies
View Related
Nov 13, 2011
i'm using DBP to fill a 48 page catalog in ventura 10 with 500 product descriptions (up to 600 characters) and small .jpg photos in tables (six columns). the data is .dbf format (dbaseIV from access2000) including a memo-field and .jpg links. depending on the sort order and/or filtering (selection of ) the items it either:
1. works like a dream or
2. most commonly, the tables (including the headers) have additional empty rows around each item
with exactly the same data just sorted differently the results can be different (with or without empty rows). the result is 100% repeatable using the same recipe/sorting.i can't see any difference in the .txt files apart from the sort order of the table contents.the .jpgs are all 600 x 600px and the frame preset to 2.1cm x 2.1 cm..default page fonts all set to 7pt to avoid row height > page size
View 3 Replies
View Related
Aug 6, 2013
I am working on the AutoCAD customization and doing the same by VB.Net & C#.Net. But I just want to know the difference as mentioned below:
1. Insert Block In AutoCAD
Using VB.Net without using DataBase services..Only 1 statement is required to Insert the Block objAcadDocument.ModelSpace.InsertBlock(Required Arguments are here) Using C#.Net with DataBase services
There are many statments are there to insert only 1 block..Like Start Transaction, Lock the document, Get the Object Id Block etc...So my quetion is that when I have to use DataBase services and when not
what is the advantage of doing customization using DataBase services rather than go for wihout DataBase services.?
View 4 Replies
View Related
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
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
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
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
May 17, 2012
Where do i set my ctb settings in 2013?
View 3 Replies
View Related
Nov 15, 2011
We have written a VB6 program for non-Inventor users that uses the Autodesk Inventor Object Library from an install of the Inventor Viewer 2011-2012. The program collects drawing sets from a VaultMirror folder exported from the actual Inventor vault. In addition, the program exports assembly parts to a formatted Excel file for purchasing.
We thought that it worked fine but, have recently found an issue: the program reads and exports ALL items referenced in an assembly, not just items in the parts list. For a particular assembly that I am using to test with, there are seven items in the parts list but, 23 parts referenced in total in the assembly. So, we get an Excel export with 23 + line items and when plotting to pdf, get 23 pdf files instead of the seven that should be created.
We are using the ApprenticeServerComponent to open the file objects but, I can't find a parts list. I have reviewed a number of posted examples of accesing parts lists and opening ApprenticeServerDrawingDocument objects but, nothing seems to work. It is like I don't have access to all of the object types needed to make it happen.
Should I be trying to open an iam or idw to access the parts list?
Are there any very basic code examples available of accessing a parts list?
View 1 Replies
View Related
Jul 13, 2012
How we can access the part parameters after hitting create iAssembly. do I need to make i parts first and then bring them to an assembly and make an iAssembly??
View 5 Replies
View Related
Nov 19, 2012
In C3D (2012 or 2013), the Pipe Properties Dialog reports "Hydraulic Properties" of a pipe section. Through .Net (C#), I can access part data such as Hydraulic gradient etc but I cannot seem to find any reference to three members I see on the mentioned dialog aka "Flow Rate", "Junction loss" and "Return period".
I have "fudged" a term "Flow Rate" into the pipe part parameter definition file (AeccPartParamCfg.xml) and can access that programmatically but I think this "Flow Rate" in the Pipe Properties Dialog" is part of the Auotcad database and I cannot seem to find a route to get hold of it.
View 2 Replies
View Related
Feb 3, 2011
iLogic has the capabilities to access the physical properties of part files such as mass / area / volume etc. ilogic syntax to read the inertial properties of the part file such as Global Ixx / Iyy / Izz??
I can find it in the API help, but i don't really want to write it as separate code, just want to simply access it through iLogic interface.
Dell Precision M6400 - C2D 2.66 / 8gb / Quadro FX3700M / Win 7 Pro x64
View 4 Replies
View Related
Nov 20, 2012
In C3D (2012 or 2013), the Pipe Properties Dialog reports "Hydraulic Properties" of a pipe section. Through .Net (C#), I can access part data such as Hydraulic gradient etc but I cannot seem to find any reference to three members I see on the mentioned dialog aka "Flow Rate", "Junction loss" and "Return period".
I have "fudged" a term "Flow Rate" into the pipe part parameter definition file (AeccPartParamCfg.xml) and can access that programmatically but I think this "Flow Rate" in the Pipe Properties Dialog" is part of the Auotcad database and I cannot seem to find a route to get hold of it.
View 9 Replies
View Related
Nov 27, 2012
I'm currently creating a program to replace all fasteners in an assembly with there Metric / Imperial opposites. My program works and I've created a log file for any issues that do come up.
My question now is:
Is there any way to manipulate bolted connections through the API? Or is this not supported yet?
I cannot seem to find anything to do with them. It's strange though as my program creates an error log for the Lock Washers in the Bolted Connection (which it was struggling with previously anyways), but shows the other fasteners as being successful.
View 4 Replies
View Related
Aug 22, 2012
I'm crating a macro wich would allow me to select multiple parts in an assembly and then calculate the length of each part. The parts are tubes wich are made of a sinlge sweep.
I started from the example truesweeplength, and built from there.
Now my problem is accessing the sweepfeature from the assembly.
In the part enviroment i use this:
Dim oDoc As PartDocument
Dim oDef As PartComponentDefinition
Dim osweepcount As Long
Set oDoc = ThisApplication.ActiveDocument
Set oDef = oDoc.ComponentDefinition
osweepcount = oDef.Features.SweepFeatures.Count
The sweepcount is simply to check how many sweep features are in the part.
This works fine in part level.Now from assembly level I first create an obecjtcollection from all the parts I selected
Set oOccurrences = ThisApplication.TransientObjects.CreateObjectCollection
Then I try to acces the first occurence
oDoc.SelectSet.Item(1)
But then I'm stuck. I cant find the way to acess the features of the selected part.
View 6 Replies
View Related
Oct 28, 2013
I'm trying to access a paramter thats in a sub-assemby 3 sub-assemby deep, is this possible?
I have tried a few thigns incluiding this, but it doesn't work.
Parameter(MakePath("MegaStalls:1", MakePath("Stall_1", MakePath("Pilaster:1", "xPilaster:1"))), "pilasterHeight")
View 6 Replies
View Related
Dec 12, 2013
I have installed Inventor 2014 and Revit 2014 on to Windows 8.1 64 Bit.The install went fine.
The only problem I have struck is that for instant if I create a new Assembly and want to open the Content Center from Assemble - Place - Place from Content Center. Nothing happens when I go through this path way, there's no error, you know it's trying as the harddrive light is flashing away rapidly for a few minutes each time you ask for it to open.
What I have tired so far is to install service pack 1 and update 1 to service pack 1, neither have made a difference.
View 6 Replies
View Related
Jun 19, 2013
How to access the information stored with an AcDbScale object using Visual Lisp. I can convert the vla-object to an ename and then use association codes to extract the data, but surely there's an easier, more direct alternative.
View 9 Replies
View Related
Apr 19, 2012
I have a small app to create, related to point clouds.
I know VisualLISP pretty well, definitely well enough to accomplish the task.but...I can't figure out how to retrieve information on the point cloud's clipbox using lisp.
I know a little VB.NET; I took a one-semester class at the JC, two years ago. It's going to take time for me to get ramped up enough with VB to do this job, so I don't really want you to tell me the only way to get to the clipbox is through vb.
way to retrieve and modify a point cloud's clipbox with VisualLISP?
View 3 Replies
View Related
Dec 3, 2012
I made a simple dialog to access some of the iproperties. This is quite handy when working on a drawing of a part, but there is one flaw with this script. If the part's description has a function referencing the parts dimensions for instance, when my script gets the description it gets the plain text and not the formula. Meaning if the part's description is "=<d0> X <d1> X <d2>" and appears as "1 X 2 X 3" the script will get "1 X 2 X 3" and when it resaves the description it will over write the formula with plain text.
Is it possible to get the formula so my script could display that for editing instead of the plain text?
Below is a part of the code I'm using and it's the standard code I've seen for retreiving ipropterties.
Dim invDoc As Document Set invDoc = ThisApplication.Documents.ItemByName(GetToken(PartList.Value, 3, Chr(1))) Dim invDesignInfo As PropertySet Set invDesignInfo = invDoc.PropertySets.Item("Design Tracking Properties") Dim invProperty(1 To 4) As Property Set invProperty(1) = invDesignInfo.Item("Part Number") partnumber.Value = invProperty(1).Value Set invProperty(2) = invDesignInfo.Item("Description") description.Value = invProperty(2).Value
View 1 Replies
View Related
Mar 30, 2007
Hatch objects: Note To access this property, use the IAcadHatch2 interface.How can I access the Object.Area of an AutoCAD hatch. AutoCAD 2006 has properties that can be assigned to Fields so why can't I find the object att- area in any lisp vars?
View 7 Replies
View Related
Jun 5, 2012
In Autocad Architectural 2012 if I typed 'wall' I would get several options for walls. If I selected 'A' (add) it would bring up the properties panel and draw the necessary walls. This does not work in Architectural 2013. Where to I access the wall/window/door pallet?
View 4 Replies
View Related
Jun 3, 2013
I have a new project coming up where I need to write some simple programs to access the dynamic action parameters in some existing dynamic blocks.I have viewed what I could find on AU, but I still ave not found anything relating in-depth to dynamic blocks.
Any good Tutorials, Articles, or White Papers, on working with dynamic blocks with autolisp/ vlisp? The main function is to access a parameter and change it by entering a numeric value, updating the block. say from a linear/polar stretch, or a linear/ polar move.
View 4 Replies
View Related
Jan 6, 2012
I have 2 SHP files, one with lot information, the other with OCP. I created a join between the two tables but the resulting data was not spatially related. The objective is to show the land use of each lot.
View 6 Replies
View Related