AutoCAD .NET :: How To Check BlockReference

Jan 3, 2013

So i have 3 file DWG :

3.dwg : is a plan 'archi'
2.dwg is a plan with only décoration.
1. dwg is a plan with only the water.

i have this structure in my file (1.dwg) :

1.dwg
---> 2..dwg
---------> 3.dwg   (this file is a Xref of 2.dwg)

--> is the blockRefecence (XRef).

Dim CollXref As New ObjectIdCollection Dim mydb As Database = Application.DocumentManager.MdiActiveDocument.Database Dim myTrans As Transaction = mydb.TransactionManager.StartTransaction ' Dim doc As Document = Application.DocumentManager.MdiActiveDocument
[Code] ......

So i don't want to add Id of a Xref From a Xref. (In my example i want only ObjectId of the 2.dwg not 3.dwg if i launch this code on 1.dwg.

View 3 Replies


ADVERTISEMENT

AutoCAD .NET :: Sum Attribute Value Of Blockreference?

Mar 8, 2013

Do we have any way to sum attribute value (integer) of many blocks fast?

View 8 Replies View Related

AutoCAD .NET :: How To Get Block Description Through Blockreference

Dec 28, 2013

my block is a anonymous block with a blockname like "*uxxx", but,but it is not a dynamic block.

how can i get the block description through the blockreference(insert)?

View 1 Replies View Related

AutoCAD .NET :: Overrule Control In BlockReference?

Jun 26, 2012

I am working on simple WorldDraw overrule where lines and polylines are displayed with little cross. Size of cross is related to view size.

Everything works fine except blocks and Xrefs. If they are scaled then crosses are scaled as well.

I know how to get entity owner ID but it refers to BlockTableRecord only not to BlockReference.

View 3 Replies View Related

AutoCAD .NET :: Modified Event Of BlockReference Causes Crash

Dec 11, 2012

I have a group of classes that essentially implement the Model View Controller pattern. The view is a custom control contained in a PaletteSet. The Model is a class that wraps the ObjectID of a given block. I've used these classes to create a replacement for the Properties tool in AutoCAD (2011). Basically the UI can be used to edit the properties of a Dynamic Block. But I apply my own rules and behaviors to the UI.

I had no problems until I added support for the View to be updated when the block is modified (say by dragging to increase a length property). To do this I handle the Modified event of the block. After the block is modified, some rules are evaluated. If the rules result in changes to the block's properties, these changes are applied. This last part is where I'm having trouble. 

When the "Rule Evaluation" code is invoked because of changes to the view (WinForms Controls), I am able to update the block's Properties using the following code without issue:

Public Shared Function SetParameter(ByVal BlockID As ObjectId, ByVal ParameterName As String, ByVal Value As Double) As Boolean
Using dl As DocumentLock = Application.DocumentManager.MdiActiveDocument.LockDocument(DocumentLockMode.ProtectedAutoWrite, Nothing, Nothing, True)
Using myTrans As Transaction = BlockID.Database.TransactionManager.StartTransaction
Dim myBRef As BlockReference = BlockID.GetObject(OpenMode.ForWrite)
For Each myDynamProp As DynamicBlockReferenceProperty In myBRef.DynamicBlockReferencePropertyCollection
If myDynamProp.PropertyName.Equals(ParameterName, StringComparison.OrdinalIgnoreCase) Then
myDynamProp.Value = Value
myTrans.Commit()
Return True
End If
Next
Return False
End Using
End Using
End Function

However, when this same code is invoked as a result of the BlockReference Modified event, AutoCAD completely crashes the momment the transaction.Commit() method is called. I've attempted to catch the exception causing the crash and role back the transaction, but AutoCAD simply exits and displays the error (Error handler re-entered. Exiting now.) and no exception is caught. Note that I do not use the BlockReference instance passed to the Modified event handler. Instead I store an ObjectID instance elsewhere which is consistently used to read/write the block. 

Is there something I must do before commiting a transaction when using the Modified event of BlockReference? I checked, and the same "Main Thread" is executing whether the code is invoked from a UI event or the Modified event. I tried calling the Close method, which is attributed as Obsolete, on the BlockReference object before executing the transaction without any success.

View 3 Replies View Related

AutoCAD .NET :: Inserting BlockReference With AttributeReferences From Another Drawing

Apr 24, 2011

I need to insert Blocks with Attributes and its values from another drawing into the active drawing.  I am not sure if the way I am doing it is correct.  I am having problems with the transactions, one for the source drawing and the other for the active drawing.  I had a few eviolations problems.  It seems that I have to close the transaction of the source drawing before I can access the active drawing and the other way around.

Since it is a BlockReference with AttributeReferences and its values I firstt opened the source drawing on a side database withing its own transaction and went through the ModelSpace TableRecord until finding the BlockReference with the correct AttributeReference value.  Then, I had to store all the Tags and TextStrings on an array because I could not access the active drawing without closing the source drawing transaction. 

If the BlockDefinition exists on the active drawing then I only have to create a new BlockReference with the AttributeReferences and update its TextStrings with the values stored on the array.  All of this withing the active drawing transaction. 

If the BlockDefinition does not exist on the active drawing I could insert it  from the source drawing side database ONLY within the active drawing transaction.  I have to close the source drawing transaction first. 

Now, is there any way of doing this that won't require switching transactions?  Is it possible to find the BlockRefence on the source drawing from the active drawing transaction? 

View 3 Replies View Related

AutoCAD .NET :: Blockreference Position And View Coordinate System?

Aug 5, 2013

I have rotated my view about 15 degress (just for this example).Now I prompt user to select the point, which is also an insertion point of the block.

So we have:

- selected point: X=0, Y=294, Z=0;

- insertion point of the block: X=0, Y=294, Z=0

(this is what I have in properties list or when I execute LIST command).

Now in my

ed.WriteMessage("
Base X: " + basePoint.X.ToString()); ed.WriteMessage("
Base Y: " + basePoint.Y.ToString()); ed.WriteMessage("
Block X: " + blkRef.Position.X.ToString()); ed.WriteMessage("
Block Y: " + blkRef.Position.Y.ToString());

 This gives me:

Base X: -2.89976376244283E-14 - OK
Base Y: 294.058394637539 - OK
Block X: -76.1079129044681 - BAD
Block Y: 284.038597817502 - BAD

My question - why blockReference position is different that it should be?

View 2 Replies View Related

AutoCAD .NET :: Selecting Nested Entities And Inheriting From BlockReference

May 1, 2012

My primary goal in this exercise is to select a nested polyline within a block and have access to its grips. I'm still not even sure if it's possible.

However, before I'm even getting to that stage I'm hitting some problems. I have some custom objects which all in some way or another inherit from BlockReference:

BlockReference

-Derived Abstract Class with common attributes

-Derived Concrete Class1

-Derived Concrete Class2

-Derived Concrete Class3

I insert instances of my derived concrete classes using jigs( Class2 for example is created using a polyline jig). However, when I select the block generated from it using a PromptSelectionResult, it returns a BlockReference, not the derived concrete class, not the derived abstract class.

When I try and cast that as the correct class type I get an error telling me I can't cast from the Base class to any of the derived classes.

So, firstly, why is it returning a BlockReference when the object I'm clicking on is an instance of a type that indirectly inherits BlockReference? And is it even possible to gain access to a nested entity's grips? I followed post here: [URL] .... but it doesn't give me what I need.

I've tried ed.GetNestedEntity and the AllowSubSelections property of PromptSelectionOptions and had little joy.

View 3 Replies View Related

AutoCAD Civil 3D :: Map Check Report

Mar 8, 2012

I'm need to make a Map Check report on C3D2011, but I don't know how to do it. Since C3D everything have to be setup before it can be use, so my questions are: How do I setup map check? Or What do I need to do get map check report?

What are the steps to do it right?

View 3 Replies View Related

AutoCAD .NET :: Check If File Open?

Mar 15, 2012

I need to export data to an excel file but I need to check if the file is already open.

Searching the internet I found this but I don't know what "imports" to use to use to enable it. 

Public Function FileInUse(ByVal sFile As String) As Boolean If System.IO.File.Exists(sFile) Then Try Dim F As Short = FreeFile() FileOpen(F, sFile, OpenMode.Binary, OpenAccess.ReadWrite, OpenShare.LockReadWrite) FileClose(F) Catch Return True End Try End If End Function

View 4 Replies View Related

AutoCAD Inventor :: How To Check Model

Dec 2, 2012

If any easy method to check the model in the inventor.now i doing each feature i have to check the fully constrained or not.if any easy method.

View 8 Replies View Related

AutoCAD Inventor :: Check For Existing IDW

Oct 7, 2013

Im thinking of adding some kind of info that tells me if the active ipt or iam have an idw, by the same name. It should be available/visible when opening, or editing parts and assys.

View 3 Replies View Related

AutoCAD Civil 3D :: Using Visibility Check

Mar 21, 2013

I have a lack of expierence in using visibility checks. I created road profile , now i would like to check the visibility of it. Cuz my profile have hills , and the car driver must see other objects in the road  . His sight in front should be 400 meters , eyes height 1 meter and the target in 400 distance should be seen by 1 meter tall.

View 1 Replies View Related

AutoCAD .NET :: How To Check Print In Landscape

Sep 7, 2011

I am working on a batch print application. I check the page info in current layout. I like to know if it's landscape or portrait? How I can do it in the code? 

View 1 Replies View Related

AutoCAD LT :: How To Check Radius Of Polyline Arc

Oct 31, 2012

how to check the radius of a polyline arc?

View 6 Replies View Related

AutoCAD Map 3D :: FDO Error To Check-in Features

Nov 22, 2008

When I try to check-in a feature to table that is stored on SQL Server I get this message: "'FdoSpatialGridTransform::CalculateParameters': The resolution is too large (> 0.1) for the extents."

View 4 Replies View Related

AutoCad :: How To Check Print History

Feb 20, 2007

I want to be able to see if any documents were printed from my computer last friday, but I'm not sure how to.

View 9 Replies View Related

AutoCad 3D :: How To Check For Object Collision

Jul 26, 2013

I have some model boat plans (scanned images) and would like to convert them to 3D objects. I used a software img2cad for the conversion, and since the conversion is not perfect i have to redraw all the parts. So here are my questions:

1. For the parts i mostly used lines, splines and arc. What is the best way to join them, so later i can edit them to 3d solid object? I used join and it works well, however it creates a small angled edge at the end. (see image or zoom in dwg file).
2. For some of the parts the extrude command works only on the edges of the 2D object creating a hollow 3D object. How do i fill the inside?
3. In near future i would need to assemble all the parts and make the skeleton of the boat. Is there a way to check for object collision (if parts are too big for example to fit where they should)?

I also attached a file with two ribs of the boat as an example.

View 7 Replies View Related

AutoCAD .NET :: How To Check Type Of Entity Selected

Apr 8, 2010

is there any way to check the entity selected by NonInteractivePickPoint? iwant to get the ownerid if the item selected is a 3d or 2d vertex. How is it written in vb.net?

View 3 Replies View Related

AutoCAD VB :: Check Block Insert Within Certain Coordinate?

Nov 2, 2011

The below VBScript code is from a property set definition in AutoCAD MEP...

The below works to return the effective name of a block that exists with a certain entity handle. How might I check if the blocks insertion point is at a particular coordinate by a fuz factor? ... and then if is not set then clear out the XData?

On Error Resume Next
Set AcadApp =  GetObject(,"AutoCAD.Application")
AcadVerString = AcadApp.ActiveDocument.GetVariable("ACADVER")
Select Case AcadVerString
   Case "18.1s (LMS Tech)"
    aecBaseVer = "AecX.AecBaseApplication.6.5"
 
[Code] ...

View 1 Replies View Related

AutoCAD Inventor :: How To Check Type Of Browsernode

Oct 11, 2011

Is it possible to find the type of a browsernode? 

In my code I can only see that the type is a browsernode.

Should I use Browsernodedefinition to get the type?

Maybe it's not possible, so I can stop trying.
 
Dim oPane As BrowserPane = oDoc.BrowserPanes.ActivePane Dim tNode As BrowserNode = oPane.TopNode Dim oNode As BrowserNode Dim oNodes As BrowserNodesEnumerator = tNode.BrowserNodes For Each oNode In oNodes MessageBox.Show(oNode.Type) Next
 
Get control of your sheet metal files at [URL]

View 1 Replies View Related

AutoCAD .NET :: Way To Programmatically Check If DLL File Is Plugin

Oct 16, 2012

I'm looking for a way to programmatically check if a dll file is a AutoCAD plug-in, preferably getting the version too.The only thing I can think of is using

System.Reflection.Assembly.ReflectionOnlyLoad()

to load the dll, search thru its references looking for Acad-specific (acdbmgd etc.) get the reference version, compare it to a list....

View 9 Replies View Related

AutoCAD Inventor :: Spell Check In IDW Files

Apr 25, 2012

is there any way to spell check your text in an .IDW file?

Also... How can I arrange my Dimensions so that our Dimension Standards are the standard Style?

View 6 Replies View Related

AutoCAD Inventor :: 2014 - DWG Will Not Check Into Vault

May 29, 2013

I am having issues getting my .dwg files to check back in to Vault Basic. I can get all different types of files (.iam .ipt .idw) to check in without issues, but .dwg files hang and Inventor will eventually lock up.

I've tried disabling Visualization and I still cannot make it past this point. I can even tell it to check in everything at once, and it will breeze through the other files but any .dwgs will hang.

My PC Config:

Windows 7 Professional 64-bit
Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
16 GB RAM
Dual AMD Radeon HD 6450
Running Product Design Suite 2014

View 9 Replies View Related

AutoCAD Inventor :: Ilogic Max Character Check?

Dec 4, 2012

We use iproperties to describe our parts and have a 40 character limit. Is there any way ilogic could be used to check and possibly warn if an iprop field exceeds 40 characters?

Inventor 2010 Pro SP4, Vault Collaboration 2010
HP Z820 Xeon E5-2643 0 @ 3.3Ghz 16.0GB RAM
Nvidia Quadro 5000

View 5 Replies View Related

AutoCAD Inventor :: ILogic - Check Only One Checkbox?

Jul 29, 2013

I need to create a form with several options, corresponding to parts to load/unload. Only 1 checkbox can be activated at a time, so when I check a check box, the others have to be unchecked. In VB this should be radio buttons, is it possible to have the same issue in iLogic with checkboxes ?

View 3 Replies View Related

AutoCAD Inventor :: Check If UserParameter Already Exists

Nov 8, 2005

The following code adds three user parameters to an .ipt:

Public Sub AddUserParams()
Dim oDoc As PartDocument
Set oDoc = ThisApplication.ActiveDocument

[Code].....

If I run this on a part that already contains any of these user parameter names I get an error. Is there a way to first check for each name and skip to the next if it already exists?

Also, how the heck do I set ExposedAsProperty for each of the parameters added?

View 5 Replies View Related

AutoCAD Inventor :: 2013 Locks Up During Check In?

Sep 25, 2013

I am running Inventor 2013 with vault 2013 on a brand new system. Everything was working great for a week or so, then inventor started to lock up during checkin. It would lock up with even a small simple part. I had the IT department try to remote in and change settings, with not luck. Then they "rebuilt" the system over again, this got things working  for about another week and after that the problem started up again. 

View 1 Replies View Related

AutoCAD Inventor :: How To Check For Assembly Integrity

Feb 21, 2013

I am working with a fellow Inventor user who faces determining if a set of assemblies, on the file system, are complete and not missing any parts, references, etc. Aside from opening each one in Inventor direclty and manually verifying if the design is at least able to resolve al parts, is there any way to automate or semi-automate this check?

View 6 Replies View Related

AutoCAD 2013 :: Check Annotative Box In DIMSTYLE?

Jan 29, 2013

Can a DIMSTYLE with annotative box checked be used in Layout or Paper Space? If so, are dimension at risk of losing their associative to part being dimension or be subject to change their Scale Factor when moving model or a different user (machine) opens the file?

View 2 Replies View Related

AutoCAD .NET :: How To Check Drawing File Is Opened

Mar 1, 2013

I have scenario where user can  open the drawing using filepath like given below

Application.DocumentManager.Open(filePath, IsReadOnly);

And it is working fine.

I should allow to open the file, if file is already opened state.

View 7 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved