AutoCAD .NET :: Have ObjectID Of Block Need To Retrieve Info
Sep 3, 2013
I have stored within an external database a handle of an entity within a drawing. If I have that drawing open and I retrieve that handle and then get the ObjectID from that Handle how do I convert that to a BlockReference so that I can then get position and attrribute values. I can get the position and attributes if I can just get the blockreference from the Object ID.
I am using the following code to get the ObjectID from the Handle:
Public Function ObjectIdFromHandle(db As Database, strHandle As String) As ObjectId Dim nHandle As Int32 = Int32.Parse(strHandle, Globalization.NumberStyles.AllowHexSpecifier) Dim handle As New Handle(nHandle) Dim ids(0) As ObjectId Try ids(0) = db.GetObjectId(False, handle, 0) Catch ex As Exception MsgBox(ex.Message.ToString, MsgBoxStyle.Exclamation, "Error in ObjectIDfromHandle") End Try Return ids(0) 'Return db.GetObjectId(False, handle, 0) End Function
I then want to use this ObjectID to get the BlockReference.
How can I retrieve a block from DWG file using Objectarx SDK.Lets say I have a cinema hall design with a lot of chairs and I am using a blcok named chair to design it. Now I want to retrive this blocks and their positions. Is it possible?
I have a block named "WIDGET-A". And in that block are (4) attribute tags whose names are:
"ID" "TAG01" "TAG02" "TAG03"
The user will be prompted to pick the value displayed at any of the "TAG##" attributes - they will select the attribute tag they want (we don't know which one it is, we just want to assign that value of the attribute tag they clicked on to a variable called "VAR2".
Now, what we also want AutoCAD to evaluate, behind the scenes, is the value of the attribute tag named "ID" which we know always exists in the block and then assign that value to a variable called "VAR1".
Is there a way for AutoCAD to do this all from only a single user pick on top of an attribute value, in a block whose name isn't always going to be 'WIDGET-A' either.... But the block, whatever it's name, will always have the attribute tag "ID" with a value in it, and we always want to capture the value of whatever attribute tag within the block that the user clicked on.
I've created a custom title block. I'd like to use VB to fill in this title block using info obtained from an Excel Spreadsheet; Company Name, Location, Drawing Title, etc.
Is there a way to display the projection (FL-W83) or Datum (NAD83) of a DWG file in the titleblock? Maybe using fields, or a diesel expression of some sort? I belive the information resides in the .NET framework, how can I get that into my titleblock?
HP Z400 Workstation Intel Xeon W3550 -Cores 4 12GB Triple-Channel DDR3 @ 533MHz 2-HP LE2201w @ 1680x1050 ATI FirePro V3800 (FireGL) (HP) MS Windows 7 64-bit
Our professor provided us with 3 dwg files that we are supposed to use for our title blocks on all construction documents. One is the title block file, one is a file with preloaded client info text and the other is preloaded with project info text. This includes dates(drawing, revisions, etc.), page numbers, sheet names, etc.
He explained how it's easier to xref all of these files into the paper space of our working files, but I don't understand how this is easier when every page has different information on it - in the very least a different page number and sheet/drawing name.
Is this a matter of creating a unique file for each page of our set of plans? This seems much more confusing that just inputting the text manually on each drawing.
I can store some ObjectId from my drawing to text file. After that how we can get back ObjectId from string read from that text file. Or have a diferrent way to store the ObjectID.
I have a list of blocks in a datagrid. When i double click a certain record it gets the objectid or handle.
Now i know how too highlight the object. But i don't want to highlight the entity but select it so i can change it's property's in the property pallet.
In the first screen shot you see the code i have. wicht highligts the record but the propperty pallet display no object selected.
But i want it to work like the next picture.
So the question is. When i know an entity's objectid or handle how do i select that entity programticly.
I have a drawing with a Polyline filled with Hatch. Also I have that Polyline ObjectId. So using this ployline ObjectId I want to erase the Hatch inside polyline. How I can erase the Hatch.
I need to use the Handle of the cloned object during a DeepClone override but AutoCAD shuts down when I try to use it.
This is the best I can think of but it still boots me out when I try.
Public Overrides Function DeepClone(ByVal dbObject As DBObject, ByVal ownerObject As DBObject, ByVal idMap As IdMapping, ByVal isPrimary As Boolean) As DBObject Try Return MyBase.DeepClone(dbObject, ownerObject, idMap, isPrimary) Catch Finally CompileCloneObjects(dbObject.Handle.ToString, MyBase.DeepClone(dbObject, ownerObject, idMap, isPrimary).Handle.ToString) End Try End Function
I create a polyline ,and then add it's objectId to a ObjectIdCollection defined by me.After the polyline is created,I would like to obtain it's second and sixth vertexes via this polyline's objectId.
I need to make my application compatible with 2008 and have one error saying that ObjectClass is not a member of SubEntId (As ObjectID) in my InsertBlock routine.
Public Sub InsertBlock(ByVal blockname As String, ByVal trans As Transaction) Dim db As Database = Application.DocumentManager.MdiActiveDocument.Database ' Test if block exists in the block table Dim bt As BlockTable =
If I have a list of handles for Autocad Entities, how would I go about selecting these entities on screen so that the user could add to this selection or remove objects from the selection? I could go with object ids as well if needed.
I have been searching and searching and coming up empty handed or at least coming up with information that doesn't seem to do what I want.
I wrote code for an application that stores links to lines and blocks in dictionaries using handles. The routines work well and I can manipulate the data marvelously, but if one of the lines or blocks get erased the whole danged opera falls apart. I knew this when I wrote the routines and have always been careful about using the ERASE command, as a matter of fact, I considered disabling it.
I am trying to make the package more robust. I have been experimenting with attaching a reactor (:vlr-erased) to the objects which fires when the object is erased. Unfortunately it fires before I can retrieve the handle of the object so that I can remove the references from the dictionaries. The only thing that I can retrieve once ERASE fires is the ObjectID. I can't seem to find a Visual Lisp routine to convert this value to a handle, does one exist? Is there an ObjectID collection that has any references in it?
My dvb project file was getting bigger and bigger so I decided to split it into individual files. However, I want to have one file that contains all my library images and I had hoped to reference this library from all the other projects.
So, I have a MASTER.dvb project which contains a library of images, one of which is called LOGO.
In TITLEBLOCK.dvb I want to refer to that LOGO image and place it in my userform.
When everything was together I used LogoTB.Picture = Library.LOGO.Picture.
How do I modify this? I tried LogoTB.Picture = MASTER!Library.LOGO.Picture and variations thereof but can't get it to work.
In the past we filled in our changes, we did on the part, in the iProperties of the IDW. In the IDW we use some Custom iProperties for this. That's not usefull because you want this data in the 3D-model. Now I have written some code to automate this, which works really great. This code works in the IPT as well as the IDW. But what I want to achieve is: When my IPT is the active document, I want to read out the iProperties from the IDW to check if there is already filled some of these properties, because I have to deal with 'old' documents as well.
So my basis question is: How can I read out iProperties from an IDW into the IPT. I have found lots of solutions which go the opposite direction, IPT -> IDW. I want IDW -> IPT.
i am going to calculate the cost estimation for civil engineering process.so i have to retrieve the data from autocad or 3d max images.how can i retrieve the data from 3d images.
I develop addins for Inventor primarily, so the AutoCAD api is very new to me. I'm working in AutoCAD 2010 and visual studio 2012.
I've looked at many posts for getting block attributes, but they either seem to assume I already have the Blockreference, or they give a prompt to the user. I'm hoping to avoid both of those.
I know the info I need is inside of a blockTable by the name of "DET".
Database acCurDb = openDoc.Database;using (Transaction acTrans = CurDb.TransactionManager.StartTransaction()) { //How can I access the blockreference in here which corresponds to the blockTable "DET"? }
I have created a pipe using sweep through 2 planes and 3d sketch. I want a specific bend on that pipe to be extracted for drawing purpose. How do I do that ?
I'm looking for a way of retrieving command names defined in an arx/dbx file, and doing it from an external process (i.e. without loading the file into AutoCAD).Ditto for checking the Acad version the arx was compiled for.
I try to retrieve the values of an occurrence in an assembly document, same as when I click on 'Change size' (see the attachment).
I Know how to get key values (from list) from content center family member (Getting data from content center) but for the expression values (from user entries), I found nothing.
In Inventor 2010 is it possible to retrieve the dimensions from the weld in an idw without rewriting this dimensions?Now when hitting weldings in idw the symbol stays empty.