AutoCAD .NET :: XData To Polyline And Blocks

Apr 10, 2013

I am trying to store some data to polyline entities. and I'm planning to use xdata. Is it possible to store some string and integer values? Also each of them should have a tag name like block attiribute names.

For example:

Type= "XLPE"
Capacity= "Medium"
LengthMultiplier= 3
thickness=5
etc.

I searched internet for utilizing xdata, and it seems that Xdata is only for predefined types such as: datalayername, dataycoordinate, datazcoordinate,datascale etc. And it seems it is not possible to store more than one string with tag name.

View 1 Replies


ADVERTISEMENT

AutoCAD 2010 :: Polyline Width In Blocks

Sep 11, 2012

I am trying to create a block that contains polylines. these polylines need to be able to have the width of them set individually.

What parameter do i need to assign so that this can happen?

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Draw Polyline Between Two Blocks Of Same Name

Nov 13, 2013

i need a vlisp program to draw polyline between two blocks.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Counting Blocks Which Are In Closed Polyline?

Oct 19, 2011

Is there a routine that I could use to count the blocks that are in a closed polyline?  The blocks may have or not one or more attributes.

In a previous session I saw a routine which was counting the blocks which had attributes in them, but it doesn't really work, because some of the blocks dont have attributes.

Also is there a routine that counts the different texts that are in the same polyline?

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Assigning Attributes To Blocks Using Polyline To Sequence Order

Sep 4, 2011

Any routine that will allow to draw a polyline through existing blocks, in the order the blocks should be numbered? Therefore when the sequence has been specified by the polyline then user to define the number system required, and the blocks are automatically numbered in the sequence of the polyine start to finish.

View 9 Replies View Related

AutoCAD .NET :: Changing Xdata

Sep 6, 2011

Why this code doesn't modify the xdata. I copied and modified another post.

it doesn't throw any errors. and objNewResBuf seems to have the right data.

Private Sub ChangeXData(ByVal objEntId As ObjectId,
ByVal strAppName As String)
Dim objDB As Database = objEntId.Database
Dim objTrans As Transaction = objDB.TransactionManager.StartTransaction
Dim objEnt As Entity = CType(objTrans.GetObject(objEntId, OpenMode.ForWrite,

[Code]....

View 2 Replies View Related

AutoCAD .NET :: Can't Dispose Xdata

Feb 13, 2012

i have a combo box which choose from 3 items one is blank. the triggered item changed event will erase the old set of corresponding xdata in the selected object and populate with new ones read from different text boxes. i was able to set the xdata for the first time ok. but when trying to dispose it won't dispose.

Imports System.RuntimeImports Autodesk.AutoCAD.RuntimeImports Autodesk.AutoCAD.ApplicationServicesImports Autodesk.AutoCAD.EditorInputImports Autodesk.AutoCAD.DatabaseServicesImports AcApp = Autodesk.AutoCAD.ApplicationServices.ApplicationImports

[Code]....

Civil 3D 2012
Work: Xeon W3503, 12GB, Quadro 2000, Dell P2211H x 2
Home: 3930k, 12GB, GTX 590, U3011, QX2710

View 6 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 :: Copying And Pasting XData Between Drawings

Sep 8, 2011

How can know if entities are being manually copied and pasted between drawings.A thought is to add a GUID to each entities Xdata and check if the value is in the named object dictionary. 

View 6 Replies View Related

AutoCAD VB :: Xdata / Reactor Length Of Lines?

Oct 7, 2013

I have a lot of lines that I need a length, like in attached file. At this moment I do it with a vba  that put fields in all lines.

The problems:

1) fields makes drawing slow to regen or after I modify line.

2) fields not follow lines slopes and position, if I stretch or move one end point of line. Text must be in middle of line.

So I thinking use reactors .

I tried reactor but I don't have much experience in lisp and I am having problems with persistent reactors, after I close file and open again, load lisp. Reactor not continue persistent. 

This is a test that I tried. Works only for one line.

(defun print-align-text ( owner reactor lst / sp ep a d )
(setq sp (vlax-curve-getstartpoint line1))
(setq ep (vlax-curve-getendpoint line1))

[Code]..... 

I have read that is better store data using XData. In VBA I tried construct class module with events, without any success.

View 9 Replies View Related

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

AutoCAD .NET :: Error When Submitting Result Buffer To Xdata

Feb 21, 2013

I'm taking over some code from a developer that is no longer here.  Right now when the code saved a resultbuffer object to xdata, I get an eregappidnotfound.  Due to various forums, I believe this is because the ID is not being registered with the database before it's being inserted.

The error is thrown on this line: XData.ToXData(partCollection);

using (Autodesk.AutoCAD.DatabaseServices.DBObject dbObj = t.GetObject(objId, Autodesk.AutoCAD.DatabaseServices.OpenMode.ForWrite)){ DeviceName.SetDeviceName((Autodesk.AutoCAD.DatabaseServices.BlockReference)dbObj, txtDeviceName.Text);
dbObj.XData = XData.ToXData(partCollection); t.Commit();}

The code for the ToXData function is here: 

public static ResultBuffer ToXData(PartCollection Parts) { //Write out some header information ResultBuffer rb = new ResultBuffer(new TypedValue(System.Convert.ToInt32(DxfCode.ExtendedDataRegAppName), XDATA_APP_NAME), new TypedValue(System.Convert.ToInt32(DxfCode.ExtendedDataInteger16), XDATA_TYPE), new [code].......

View 2 Replies View Related

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 :: 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 Visual LISP / AutoLISP :: Select Objects With Given Xdata?

Jan 2, 2012

with a function like this I added some xdata, some MULTILEADER

(defun c:add_xdata () (princ "Select: ") (setq ogg (car (entsel))) (addXdata ogg "TEST" "CODICE" "1256") (addXdata ogg "TEST" "MATERIALE" "LEGNO") (addXdata ogg "TEST" "TIPO" "A"))
 
Now with the following function can only select leaders who have linked the xdata application TEST

(setq selez_all (ssget "X" '((0 . "MULTILEADER")(-3 ("TEST")))))
 
I can not, however, find a way to select all MULTILEADER who have a particular value of XData.

For example I would select all MULTILEADER with MATERIALE = "LEGNO" and TIPO = "A".

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Retrieving Xdata From An Entity?

Mar 29, 2012

How can i build a selection set of all circles  and then retrieve the xdata attached to them? 

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Reading Xdata Info?

Oct 14, 2013

Lisp code to read xdata information?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Remove Xdata From Layer Zero

Aug 14, 2012

I have a drawing that i know has xdata attached to layer zero. the problem is, it's not an object i can find. Any routine to remove xdata from ALL objects. like a global remove xdata?

View 6 Replies View Related

AutoCAD LT :: Use Excel 2010 Into Drawings To Set Up Tables - XData Handle Unknown

Jun 20, 2013

I have LT 2012.  I use Excel 2010 into my drawings to set up tables.  When I opened the drawing I've been working on, I had lost all of yesterday's data.  Command History shows dozens of these notations, "AcDbLine(41859) XData Handle Unknown, Null"   In Help it says you can no longer turn handles off, so it should be ON.  How can I point the drawing to my Excel data?

View 2 Replies View Related

AutoCad 2D :: Drawing Polyline To Have Tooltip Box Show Cumulative Length Of Polyline

Nov 6, 2013

Is there a way, when you are drawing a polyline, to have the tooltip box show the cumulative length of the polyline, rather than the length of the current segment being drawn?

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Reduce Polyline With Multiple Vertices To Single Polyline

Jun 7, 2012

I would like to take all the vertices out of a multiple-vertices polyline so that it reduces to just its start and end points, can this be done?

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: 3D Polyline To Polyline To Spline With Max

Sep 21, 2013

Due to modeling purposes, I need to convert a 3D polyline to a spline. What I have been doing is:

- change polyline fit/smooth to cubic from properties
- convert polyline to spline by typing spline -> object
- method -> fit from properties

You can see the original 3D polyline (green) and the resulting spline (magenta) in the attached drawing.When I zoom in and measure the distance between the two entities at different points along them, at some points the perpendicular distance exceeds 5 millimeters, and I want to ensure the deviation remains under 1 millimeter or even less.

I know I can change the knot parameterization of the spline, and this does work at some locations, but the difference increases at others.Why is there a 5.6 mm difference between the spline fit point and 3D polyline vertex, as measure in the attached drawing?

Now, I can go and manually stretch the fit point to coincide with the vertex. Also, I can add fit points between existing ones to drag the spline closer to the original 3D poly.

However, some of my polys are really long, and it is very time-consuming to do this manually while measuring points along the entities to make sure the distance stays small enough.

how to automate this process? For example a lisp that would maybe take the original vertex points, add say maybe 3 (not too many) new ones between them, and then generate a spline while making sure the deviation is less than the set value of 1mm? I am using AutoCAD 2013.

View 5 Replies View Related

AutoCAD .NET :: Getting Polyline Data Into A Custom Derived Object (from Polyline)

Nov 11, 2013

I've been working on a custom polyline object, and I've got it functioning!!Having said that, I plan to run its creation around picking a point for bounary selection.

(Other than trying to step through every vertecies) is there a technique I can thow the polyline data from a traceboundary result into my custom object? I've been trying to add the polyline from traceboundary to my object BEFORE it's added to the transaction by the way...I assume that's right, since I want to put it's data in my custom object then add my custom object to the transaction instead.

View 3 Replies View Related

AutoCAD Civil 3D :: Convert Metric 3D Polyline To 2D Polyline

Jun 29, 2013

I want to convert a 3D polyline to 2D polyline.

View 5 Replies View Related

AutoCad :: Automatic Join Polyline Onto Existing Polyline?

Sep 16, 2011

Is there any way at all to draw a new polyline - from the endpoint of another polyline, and have it automatically join as one polyline from the existing section??

I know this can be done via PEDIT, but its so laborious and soo many clicks, and I have alot of segmented Polylines that I need to consolidate when I draft.

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Reactor - How To Change Xdata Length If Line Is Modified

May 18, 2010

I need a Reactor to Modify Xdata - Length - contained in Line Object if this Line is modified (stretched, breaked, trimmed, etc).The routine need to verify if Line contain Xdata and modify it (and works with multiple selection).

I tried for long hours, but without success. I tried to create a list of entities while the reactor is applied, but doing so need another reactor to change these entities after the first Reactor works.The codes I used are below:

{code}
;If it just 1 string only you want to add
(defun add_xdata_str (e a v);;;EName APPID String_value
(and (not (tblsearch "APPID" a))
(regapp a))
(and (= (type e) 'ENAME)
[code]....

View 6 Replies View Related

AutoCAD Civil 3D :: Align Polyline Onto Another Polyline

Mar 22, 2012

Any way I can align a new polyline to a reference polyline (orig polyline).

The 2 polys will be generally the same length, however, the number of vertices will differ.

Also I need to mantain the same distance between the vertices on the new poly and the new and reference poly won't follow the same direction.

View 9 Replies View Related

AutoCAD .NET :: How To Find If Polyline Is Inside Another Polyline

May 18, 2011

How do you find 'if' a polyline is inside another polyline?

View 2 Replies View Related

AutoCAD 2010 :: Polyline To 2D Polyline?

Mar 2, 2012

How do you convert a closed Polyline to 2D Polyline? CONVERT does not work in reverse.

View 4 Replies View Related

AutoCad 2D :: How To Convert 2D Polyline To Polyline

Jun 25, 2008

I have 2D polylines and want to convert to polylines, but to no avail. Tried to 'spline2pline' this line, but ACAD refuse to select it.

View 9 Replies View Related

AutoCAD .NET :: If Selected Entity Xdata Contains Value Then Select Additional Entity

May 22, 2013

I would like to add additional entities to the selection if any of the selected entities contains a an xdata value.

If I put the condition into the ImpliedSelectionChanged reactor I imagine will probably loop back on itself.

View 9 Replies View Related







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