AutoCAD .NET :: Selection Filter On Block Reference XData

Apr 12, 2007

I'm trying to use a Selection Filter on Block Reference XData value. But I get no hits, it works fine with Lines and Polylines that has the same kind of XData.

Is it a bug or do I have to define my Selection Filter differently when working with Block Reference?

Here is a part of the code :

TypedValue[] flt = new TypedValue[]
{
new TypedValue(-4, " new TypedValue(-4, " new TypedValue(8, "POLYLINE_LAYER"),
new TypedValue(1001, "Object_Id"),
new TypedValue(1000, "166448"),
new TypedValue(-4, "AND>"),
[code].......

View 3 Replies


ADVERTISEMENT

AutoCAD .NET :: Selection Filter On Xdata For All Type Of Feature

Jan 6, 2010

I am trying to create selection set entity xdata(1001, 1000,1000) features like text,line,lwpolyline,insert....etc.

But its working only on linear features not working on remaining features, why?

View 4 Replies View Related

AutoCAD .NET :: Filter Block Selection By X / Y Coordinates

May 17, 2012

I'm trying to select two specific types of blocks from a drawing so that I can create layouts for each one of the pairs of blocks in my drawing.  Basically, one block is the outline of the piece of the drawing and the second contains information about the drawing.  I would like to select all of the outline blocks and then create a selection to get the second block which is inside the bounds of the first block. 

I'm not sure how to create a set of typed values to do this.  Here is my code so far which sets up a filter to get the first block and then for each of the blocks that it finds, it would select the block with all of the information which is where I am having problems.  I don't know how to create a filter based upon location of the block. 
 
using (Transaction tr = acCurDb.TransactionManager.StartTransaction()) { filList = new TypedValue[] { new TypedValue((int)DxfCode.Operator,"<and"), new TypedValue((int)DxfCode.Start,"INSERT"), new TypedValue((int)DxfCode.BlockName,"D-1*"), new TypedValue((int)DxfCode.Operator,"and>")}; // Build a filter list so that only block references are selected filter = new SelectionFilter(filList); //Select all res =
[code]........

View 2 Replies View Related

AutoCAD .NET :: Filter Dynamic Block References In Selection

Mar 22, 2012

I have a problem with selecting all references to a specific dynamic block. When I use the filter below only block “D2” is selected, which is not a dynamic block, Block "Bulb120227” which is a dyn block is not

Dim values() As TypedValue = { _
                New TypedValue(0, "INSERT"), _ 
                New TypedValue(-4, "<OR"), _ 
                New TypedValue(2, "D2"), _ 
                New TypedValue(2, "Bulb120227"), _
                New TypedValue(-4, "OR>") _ 
               }

How should the filter be done to filter out the dyn block that I want several block should be filtered out in one selection.If it is possible to achieve with just a filter at all?

View 7 Replies View Related

AutoCAD .NET :: Add XData To Appended Block

Nov 30, 2011

When capturing the Object Appended event of a block containing a "Drawing_No" attribute tag, then trying to add xdata to the object, I get a "Object reference not set to an instance of an object" error. I've tried writing the XData after committing the transaction but it didn't work.
 
If TypeOf e.DBObject Is BlockReference Then Dim bref As BlockReference = DirectCast(e.DBObject, BlockReference) If bref.AttributeCollection.Count <> 0 Then For Each attId As ObjectId In bref.AttributeCollection Dim attRef As AttributeReference = trans.GetObject(attId, OpenMode.ForRead) Select Case attRef.Tag Case "DRAWING_NO" WriteTitleBlock(e.DBObject.ObjectId) '<<Subroutine used to add XData Exit For End Select Next End If End If

View 7 Replies View Related

AutoCAD .NET :: Adding Xdata To Dynamic Block With Attribute

Aug 31, 2011

My code add xdata to any object properly except for a dynamic block with attribute. After code excutes it disappears from screen . Even undo make strange thing. I guess I screw the database somehow. But even audit doesn't show any fix applied.

Attach is a sample drawing. And below is my code.

<CommandMethod("pppp")> _ Shared Sub test1()
Dim Mydwg As Document = Application.DocumentManager.MdiActiveDocument
Dim Mydb As Database = Mydwg.Database Dim Myed As Editor = Mydwg.Editor
Dim MyRegisterApplication As String = "My_R_Cad"
[code].....

View 4 Replies View Related

AutoCAD .NET :: Error While Changing Block Definition Of An Block Reference

Oct 21, 2013

I'm trying to change block the definition of an block reference.

I did something like this:

blockreference.BlockTableRecord = newBlock.ObjectId;

In most cases this works well. However I found a case that it not work as well. When I try to change the definition from a new block that I have created in my test DWG, it disappears from the model.

View 6 Replies View Related

AutoCAD .NET :: Determine If A Block Reference Of The Block Exist

May 3, 2012

I have a block: “Block_A”. I am trying to determine if a block reference of the block exist.

Currently I would iterate every block Reference in the Block Table, and then dig deep into each block ref . . . . .

I was wondering if I could just take “Block_A” and see if it has reference and where the references are. Perhaps this is just wishful thinking but I was hoping for a faster way to obtain the references then to iterate thousands of blocks in each table record.

View 4 Replies View Related

AutoCAD .NET :: Insert Block Reference Using Block Name

Nov 17, 2012

Drawing contains a block with "BlkName". I want to insert blockreferences of this existing block using .Net. All shows how to insert a new block and then use the BlockID returned by the insert function. In my case I only have the block name and there is no Block id. How to get it or how to create a block reference of an existing block?

View 3 Replies View Related

AutoCAD .NET :: How To Get All Block Reference In A Drawing

Mar 29, 2013

I need to get list of all block reference in  a drawing without iterating through all entities in the drawing.

View 7 Replies View Related

AutoCAD .NET :: Polyline 3Ds In Block Reference

Jan 11, 2013

I have a weird problem with exploding block reference with vb.net as follows.

When I use BR.explode(DBObjectCollection), and append the entities in the object collection to model space, 

the 3d Polylines inside the block reference do not get appended and I do not get any kind of error. The reason for this eludes me as of yet. (remember, simple polylines and lines and other objects do get appended to model space)

When I use BR.explodetoOwnerSpace(), the block reference explodes as it normally is expected to, but then I have no way to collect the objects from the exploded BR.

View 9 Replies View Related

AutoCAD Map 3D :: Block Reference Scale

Sep 27, 2012

I'm working with two different drawings to import Layers for Lot Grading and when I'm importing the Block Reference from the origin file, it's setup as Linescale 0.5, but when I import into my regular basemap, which is setup for Linescale 1, the text size is double what it should be. 

View 1 Replies View Related

AutoCAD VB :: Block Reference Rotation

Oct 22, 2013

I'm trying to write a vb script to extract information from the CAD drawing. While testing, i found that for some drawing blocks, the corresponding AcadBlockReference Rotation returns 1.57, but when i look at the actual drawing, block properties, the rotation is 0.

View 3 Replies View Related

AutoCAD .NET :: Selecting In Block Reference?

May 11, 2010

i need to use something with similar effect to Editor's method SelectCrossingWindow, but i need it to select object in Block Reference. How can i do that?

View 5 Replies View Related

AutoCAD .NET :: Block Reference Attributes

Jul 13, 2012

I have a block reference in a dwg that is a like a form, for example:

Written By: Diogo
Author: Diogo

Date: 13-07-2012
State: Check-in

In autocad this is a block, and on the attributes of the block reference I only can edit State and Author, and i would like to get all values. Because i want to fill those values of Written By, Author, Date and State by code. I can reach the attribute collection of the block but i only can see the State and Author.

View 7 Replies View Related

AutoCad :: Explode A Reference Block?

Jun 14, 2011

is ter any way to explode a reference block

View 4 Replies View Related

AutoCAD .NET :: Selection Set Filter

May 23, 2011

The following code filter all lines which are in the layer "0" and line weight is 0.35. But it does not. my selection set is empty. 

Dim typVal(2) As TypedValue 
 typVal(0) = New TypedValue(DxfCode.Start, "LINE") 
 typVal(1) = New TypedValue(DxfCode.LayerName, layName)
typVal(2) = New TypedValue(DxfCode.LineWeight, Convert.ToInt16(0.35))
----------------------------------------------------------------------------------------------------------
Dim sf As SelectionFilter = New SelectionFilter(typVal)
Dim ss As SelectionSet = ed.SelectAll(sf).Value

View 1 Replies View Related

AutoCAD .NET :: Select Block Reference By Attribute Value

Nov 29, 2012

I have a drawing with many block references on it and they have some attributes.

I know how to find the block reference witch the attribute value, and even change it but I don't know how to select it once I have the object ID of the block.

How can I do the selection without asking the user to select it?

View 6 Replies View Related

AutoCAD 2013 :: Label Block Reference

Aug 2, 2013

I wonder if this can be done.  i have a number of blocks which have labels to them i.e. JW1, JW2, JW3 etc. which corresponds to the block name.  Is it possible to have the label automatically referenced to the block name so if i change the block name to JW10 the label within the block changes to JW10 as well.

View 4 Replies View Related

AutoCAD .NET :: Get Block Reference Information Error

Mar 21, 2013

I get a block reference (has attribute) from other drawing as code follow:
 
Public Sub GetBlock_Info() Dim blockName As String = "test" Try Dim doc As Document = Application.DocumentManager.MdiActiveDocument Dim doclock As DocumentLock = doc.LockDocument() Dim ed As Editor = doc.Editor Dim ofd As New OpenFileDialog("Select Drawing", Nothing, "dwg; dwt", "ATS detai drawing", Autodesk.AutoCAD.Windows.OpenFileDialog.OpenFileDialogFlags.DoNotTransferRemoteFiles) Dim dr As
[code]..........

View 9 Replies View Related

AutoCAD .NET :: How To Fill Color For Block Reference

Sep 9, 2013

 i have a .dwg fille with some block reference.
 
I want to fill color for block reference, but when I debug to hatch.appendloop function, I get message eInvalidInput, and block don’t fill color.
 
This is my
 
[CommandMethod("FillColor")]
public void FillColor()
{
Document doc =
Application.DocumentManager.MdiActiveDocument;
Editor ed =
doc.Editor;
Database db =
HostApplicationServices.WorkingDatabase;
Transaction tr =
db.TransactionManager.StartTransaction();
 
[Code]....

View 1 Replies View Related

AutoCAD .NET :: Change Block Reference Attribute

Mar 7, 2010

I have an issue regarding nested entity.

I have a nested entity block reference. In this entity I have three blocks. if I change any of the block reference attribute definition in the nested block reference then it is changing the original block itself.

Actually I am getting the handle of the selected block reference in the nested Entity. and change the attribute reference later. but it is making change in the block itself and other block reference too.

Here is my

static public void CONTACTS()
{
Document doc = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument;
Editor ed = doc.Editor;
string contactName = string.Empty;//to hold contact name, from xdata
[code].......

View 3 Replies View Related

AutoCAD .NET :: How To Locate Text Near Block Reference

May 24, 2012

I have tried to use intersectwith to locate text (MText or DBText) near a block reference. Some times it works and some times it does not. The hard part for me is understanding why it occasionally works when most examples are just duplicates with modified text and attributes.

My block reference has 4 attributes  to the left (Right Justified) of a circle and 2 attributes inside the circle. The text objects are used by some CAD operators instead of the upper 2 lines of attributtes. (Guess they dont know how to modify attributes) I want to locate these texts and insert text into the corresponding attribute.

Block Reference:

Att 1   |'''''''|  <-- CAD User will insert a txt over Att 1 and Att 2, 
Att 2  |       | <--  both attributes are usally left blank or contain a space
Att 3  |       |
Att 4   |.....|

View 8 Replies View Related

AutoCAD Inventor :: Title Block Reference?

Apr 5, 2012

I have text in my title block that references part properties. If I have several different part and assembly base views on a sheet, how do I control which one the title block references? It defaults to the first one that was placed. I am using 2011 Pro.

View 1 Replies View Related

AutoCAD .NET :: Get Block Handle From Attribute Reference?

Sep 21, 2011

Is is possible to get the block handle from an attribute reference? I get the attribute reference from a previously stored attribute collection. I did try attref.BlockId.Handle.Value.ToString(), but it gives a different value, not the block's id.

View 2 Replies View Related

AutoCAD .NET :: Move Block Reference Up Or Down Vertically

Apr 23, 2013

I need to select a block in AutoCAD, and move it up or down vertically. I can get to the point where I have the user select a particular block, but after that, how do I get a reference to the block selected so I can move it up or down?

View 1 Replies View Related

AutoCad :: Delete Objects In Block Reference?

Feb 7, 2013

I have a block that I use as hatch (using superhatch), so the block appears several times. At the border of the hatch I want to fix some of the lines.

If I try to ungroup & explode the hatch, then the block appears outside of the hatch boundry.

So my question is if I can fix the lines so the hatch remains whole.

View 8 Replies View Related

AutoCad :: Using Dynamic Block As External Reference

Dec 2, 2013

Is there a possibility to use "Dynamic Blocks" as an "External Reference" having the ability to use their features at the same time?

The thing is I have dwg1 and dwg2 files and in them I use "Dynamic Block1". Whenever I update "Dynamic Block1" in one of the dwg files I have to go to "design center" and update the "Dynamic Block1" in other dwg file.

View 9 Replies View Related

AutoCad 3D :: Subtracting A Reference Block From A Solid?

Jul 26, 2013

AutoDesk 2014 . I am currently trying to design in iphone case. So I downloaded a replica iPhone from grab cad:

[URL]

I imported it and formed a solid around it, now I am trying to subtract the phone from the solid so it perfectly fits within the case. It will not let me subtract it though because the phone is a reference block and the square around it is a solid.

View 1 Replies View Related

AutoCAD .NET :: Using Block Reference As Point Symbol?

Jun 6, 2011

I create a set of points in a drawing and create each point as a block reference containing the point, text and probably something else. Also I would like to use different symbols for points and each of the symbols is defined as a block definition, and for each point I create a block reference according to the symbol type. The question is if is there any way to "combine" block definitions/references? I mean, I have common block definition for all points, whis defines somethin common for all of them. Also I have different symbols for each type of points and each symbol is defined separately as a block. But when a final point is created (containing common definitions and type-dependent symbol) I want to have it as a single block.

View 5 Replies View Related

AutoCAD .NET :: Selection Filter Typed Value Between X And Y

Jun 4, 2012

AutoCAD 2012

C#

Windows 7

I need a selection filter to find text objects within a rectangular area using dxf operators (do not want to use Editor.SelectWindow).

Whats wrong with the following code attempt?

It causes Fatal Error!

TypedValue[] tv2 = new TypedValue[15];
tv2.SetValue(new TypedValue((int)DxfCode.Start, "TEXT"), 0);
tv2.SetValue(new TypedValue((int)DxfCode.Operator, "<and"), 1);

[Code]....

View 4 Replies View Related







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