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


ADVERTISEMENT

AutoCAD .NET :: Select Nested Entities

Jan 3, 2013

I select all entities via Editor.SelectAll() method, but the nested entities (inside Blocks) are missing. Do I have to resolve them by iterating through all blocks afterwards or is there a Prompt Selection Option that can be set?

I don't want the user to select the entities, instead I loop through the whole drawing.

View 7 Replies View Related

AutoCAD .NET :: Selection Of Multiple Nested Entities?

Jan 11, 2013

There are blocks in the drawing, each containing several nested entities. Need a command which would find all the nested entities which got into the selection area provided by user (not necessary to select entities, just get the ids). GetNestedEntity() does what I need but for a single entity only. 

Selection of 'Trim' command does exactly what I need. How could I achieve the same behaviour?

View 5 Replies View Related

AutoCAD .NET :: Selecting Blocks / Entities

Jul 12, 2013

I have some blocks which are placed with some routines in VB.net and are linked by a unique code to a external data file (XML-file). I want to try to created a kind of propertybox (in a toolpalette) which indicate some of this external data values. If one of these values are changed (by changing the values in the propertybox), some routines need to be executed.

Is it possible when a object is selected (not during a command), to run a piece of code (VB.NET). I have found some basic principles about "overruling" but I'm not sure this is the correct/possible way to solve the problem and I'm not there yet.

View 4 Replies View Related

AutoCAD .NET :: Selecting Entities In Multiple Layers

Jan 15, 2013

Is it possible to select entities of multiple layers?

I've looked at... [URL] .....

...and tried the following code.
 
string[] layerNames = {"1", "2", "3"};TypedValue[] tdv = new TypedValue[(layerNames.Length * 3) + 2];int i = 0;tdv[i++] = new TypedValue((int)DxfCode.Operator, "<or");foreach (string ln in layerNames){ tdv[i] = new TypedValue((int)DxfCode.Operator, "<and"); tdv[i + 1] = new TypedValue((int)DxfCode.LayerName, ln); tdv[i + 2] = new TypedValue((int)DxfCode.Operator, "and>"); i += 3;}tdv[i - 2] = new TypedValue((int)DxfCode.Operator, "or>");SelectionFilter sf = new SelectionFilter(tdv);PromptSelectionResult psr = ed.SelectAll(sf);
 This code gives me an error in the PromptSelectionResult.

What would cause the erro?

View 1 Replies View Related

AutoCAD 2013 :: Selecting Entities - How To Close

Nov 21, 2012

I am missing entities when I try to pick on them.Not window, not crossing. Just trying to pick an entity. I usually select entities first before my command.

Is there a variable that might have changed?  I played with PICKBOX & APERTURE but this doesn't change anything when I try to select something. I can have the entity in the box right next to the intersection of the crosshairs and instead of selecting the entity it starts to window.

I have a logitech m705 mouse w/ setpoint software ver 6.32.7 & driver ver 5.33.14 installed.

View 6 Replies View Related

Revit :: Selecting Certain Color And Assigning To Part In Nested Family

Aug 5, 2013

I'm having a issue with selecting a certain color and assigning it to a part in my nested family. The problem is that when I load it into the project its grayed out.. Is there something I'm forgetting to do, or could the program possibly have a bug? Revit 2012

View 1 Replies View Related

AutoCAD Civil 3D :: Stretching Blips Without Inheriting Levels

Aug 7, 2013

I have a civil3d model and now have an amended layout which I need to update to.

xref'd layout is 2d so I want to snap blips on my feature lines from the original location to new location while maintaining their z value.

I know you can turn off and on the ability to pick z values but can't remember the command (lost notes).

I have tried changing the osnapz option with now luck.

View 2 Replies View Related

AutoCAD 2013 :: Skip Layer When Inheriting Properties In Hatch?

Nov 25, 2013

I like to use inherit properties a lot when hatching. Now it also grabs the layer and I prefer that to be bylayer always, like before when this (imo useless) option was not implemented. Does any trick to get rid of this feature I don't want.

View 4 Replies View Related

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 View Related

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

Photoshop :: 6.0.1 Not Inheriting

Mar 3, 2008

This is only happening in Photoshop (vs. other applications) from a Windows XP machine. When user tries to create a file in Photoshop (or open a file in Photoshop ) and then save from Photoshop to the network server, the file permissions on the server do not inherit. But, if the user right clicks a file (say received through an email) saves it without opening it first in Photoshop, it inherits permissions fine.

View 7 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 Architecture :: Annotative Objects Inheriting Every Annotative Scale?

Sep 19, 2012

I am running Autocad arch 2011 (as Autocad 2011)  and a co worker is using Autocad electrical 2012 and when he works in a drawing of mine the every annotative scale that is used in the file is attached to every annotative object.  Which means I have to go through every object and delete scales that should be be there....all my annotative objects appear in every view port because every annotative object has every scale..

View 2 Replies View Related

AutoCad :: Delay In Selecting Object And Selecting Command?

Sep 25, 2008

I am having a problem with a delay in selecting an object and selecting a command.

When I select an object the pointer has at least a 3 second delay before it starts moving around normally again. It is the same with selecting a command. This has started to get tedious. It has worked fine in the past so I don't think it is a RAM/graphics card problem.

View 5 Replies View Related

AutoCAD Inventor :: Mouse Selecting / Not Selecting?

May 15, 2012

OK, today, or actually just this afternoon I've noticed it has become much harder to select items with the mouse.

Points, nodes, etc...anything where you'd typically hover the mouse over the item and it highlights for you to select it.

For example, lets say you want to project a point from another sketch, or select the center node of a line, etc.

Never really had an issue until this afternoon where now it seems I have to be right on top of the item and I cannot budge one bit or it won't select it. It is now taking me numerous attempts to select things like points (zooming in does not work, points scale accordingly).

Is there a setting somewhere? I can't seem to find such under Tools>Application Options and the like.

View 8 Replies View Related

AutoCAD .NET :: Add Text In Nested Transaction

Oct 9, 2013

Im trying to figure out what I can do differently in my code to have it show the newly placed text immediately after choosing an insertion point. Im guessing it has to do with a nested transaction and my loop, but Im not sure how to fix.

The code below is to label the layer of a selected entity. If in paperspace, label in paperspace and if in modelspace label in modelspace. Ive been testing this on the "blocks_and_tables_-_imperial.dwg"

Imports Autodesk.AutoCAD.RuntimeImports Autodesk.AutoCAD.ApplicationServices.ApplicationImports Autodesk.AutoCAD.DatabaseServicesImports Autodesk.AutoCAD.EditorInputImports Autodesk.AutoCAD.GeometryImports Autodesk.AutoCADImports Autodesk.AutoCAD.ApplicationServicesPublic Class Class2 Public Function myAnnotate(myDbIn As Database, mySpace As String, myTextContents As String, mySTPT As Point3d) As ObjectId
[code]........

View 3 Replies View Related

AutoCAD .NET :: How To Get All MLeaders Even In Blocks Nested Ones

Aug 13, 2013

I need to EnableFrameText to all MLeaders in a drawing, I also want to get the MLeaders who are nested in Blocks automatically...

I started this way but It just works fine with the Mleaders in Modelspace or if I open the Blockeditor to edit Mleaders nested in a Block...

I know I'm not going to "deep", maybe I need an other Transaction, or thirst open each Block to edit... not right sure...

my example:

//Ändert leider nur die MLeader die nicht in einem Block sind....
[CommandMethod("MLeaderIterator")]
public static void MLeaderIterator_Method()

[Code]....

View 2 Replies View Related

AutoCAD .NET :: Creating Nested Block

Sep 18, 2013

sample code for creating nested blocks.

View 4 Replies View Related

AutoCAD 2010 :: Know If DWG Contains Nested Blocks?

Apr 13, 2012

Is there a quick/easy way to know if a DWG contains nested blocks?

View 6 Replies View Related

AutoCAD .NET :: Unable To Create Nested Groups?

Aug 25, 2013

I am able to create groups in autocad 2013 using .net but unable to create nested groups. I am talking about nested groups not nested group layers. 

View 9 Replies View Related

AutoCAD .NET :: Nested Blocks From Selected Subentity

Sep 27, 2013

I'm attempting to have the user select mText from a nested block within a block and then copy the nested block to model space out of the block. I'm able to change the mText successfully, but when I attempt to get the nested block it is not in the list of GetContainers() it only contains the block in model space and the model space block. The nested block is missing in the list. I'm using AutoCAD Civil 3D 2013. 

Here is the code to select the mText object which works correctly.
 
Sub GetNestedMtext() ' Have the user select an object. Using the prompt provided. Dim ed As Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor Dim entopts As New PromptNestedEntityOptions(Environment.NewLine & "Select a mText in block to replace: ") entopts.Message = Environment.NewLine & "Select a mText in block to replace: " Dim ent As PromptNestedEntityResult = Nothing Try ent = ed.GetNestedEntity(entopts) Catch ed.WriteMessage("You did not select a valid entity") End Try If ent.Status = PromptStatus.OK Then CreateDuplicateBlockInModelSpace(ent) End If End Sub
 
Here is the code that attempts to get the nested block which is missing the nested block.
 
Private Shared Sub CreateDuplicateBlockInModelSpace(ByVal ent As PromptNestedEntityResult) Try Dim containerObjIds As ObjectId() = ent.GetContainers() Dim blkToExtract As BlockReference = DirectCast(containerObjIds(1).GetObject(OpenMode.ForRead), BlockReference) Dim blkToPlace As BlockReference = blkToExtract.Clone() Dim doc As Document = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument Dim db As Database = doc.Database Using tr As Transaction = db.TransactionManager.StartTransaction Dim acBlkTbl As BlockTable acBlkTbl = tr.GetObject(db.BlockTableId, OpenMode.ForRead) Dim acBlkTblRec As BlockTableRecord acBlkTblRec = tr.GetObject(acBlkTbl(BlockTableRecord.ModelSpace), OpenMode.ForWrite) acBlkTblRec.AppendEntity(blkToPlace) tr.AddNewlyCreatedDBObject(blkToPlace, True) tr.Commit() End Using Catch ex As System.Exception End Try End Sub

 Is there another way I can get the parent block object for the nested object? 

View 5 Replies View Related

AutoCAD .NET :: Get Position / Location Of Nested Entity

Apr 16, 2012

I am trying to get either location, insertion point, or center of an entity that is inside of a block. I'm getting subentity using the Editor.GetNestedEntity. I create a FullSubEntityPath for highlighting, that works well, and I have looked at using GetSubEntityGeometricExtents using that same subentitypath, but not having any luck, I can't seem to find any documentation on using that method.

I know I can get the location of the owner, then calculate the location of the entity based off of that, but I'm looking for an easy way now, if that don't work out, I can do the lengthy approach.

View 1 Replies View Related

AutoCad 3D :: Difference Between Circular And Nested Xref

Aug 18, 2011

this question is related to 3D modeling in HVAC detailing, piping and plumbing

What is the difference between a circular and nested xref?

View 4 Replies View Related

AutoCad :: Data Extraction Nested Blocks?

Dec 13, 2011

Here is the problem with the process put simply:

Start with a new drawing Drawn a rectangle. Place a block which has an attribute with a number at each corner. ie. 1-4. Convert all objects into one single block. (the attributes become nested). If you use data extraction and retrieve the attribute number, position X and position Y, and output to a table the information displayed is correct. HOWEVER, if you rotate the block and update the link the coordinates become incorrect? This seems to be an issue with nested blocks?

View 4 Replies View Related

AutoCad :: DXF And Surface Entities?

Sep 23, 2011

looking for a way to read in the DXF data for a surface entity in AutoCAD2012. There's plenty on reading in simple objects (e.g. 3DFace, Points, etc.) but nothing on surfaces. The data itself is also not as intuitive as I would have hoped. The DXF reference PDF from AutoDesk shows 7 possible unique entries and the data I need is most likely stored in the proprietary data. So, in short I know where it is but how can I read it?

View 7 Replies View Related

AutoCAD 2010 :: Turning Off Lines In Nested Blocks?

May 30, 2013

 Autocad 2011

wondering if its possible to turn off lines inside of nested blocks.

When we tried to do this inside a heavily layered and blocked drawing, it seemed to make the file unresopnsive, unloadable, and general "autocad freezing" issues. We Reconsitituted the entire file from the ground up and found that by NOT turning off these lines inside of nested blocks (ceteris parabis) the file works fine.

We like to turn these lines off becuase different teams are working on different parts of the drawing and we like to focus on one section by turning the other off. Is this possible? Is there a better way to do this?

View 3 Replies View Related







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