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


ADVERTISEMENT

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 2D :: Select All Thirty Or Forty Of Lines And Return A Total Length Of All Of Selected Lines

Jul 9, 2012

I have selected several lines (not pl or spl), just lines, all of which are the same layer and such. I want to be able to select all thirty or forty of the lines using either the select similar (lisp, AC2010) or quick select and return a total length of all of the selected lines. In the properties box it shows as varies.

View 2 Replies View Related

AutoCAD LT :: Total The Length Of Multiple Lines?

Nov 5, 2013

I have a large group of lines that I want to get a total length of. Right now the only way that I know how to do this is to highlight them all and use the list command but then I have to go through the text box and write down each line length and then add them up. This is fine if I have only a few lines but when you get into the hundreds or thousands it becomes a monster task.

I tried copying the text box data into a Word document, removing all of the text except for the line lengths and then dumping that into Excel to calculate. This works ok for a hand full of lines but is not really practical.

I know that there are LSP routines that can do this in the full version of AutoCad but LSP is not supported in AutoCad LT.

Is there a way to automate this process in LT?

Or maybe extracting just the length data from a line to a text file where I can send it to Excel and use Excel to add up the lengths?

View 2 Replies View Related

AutoCAD LT :: Measure Length Of All Lines In Layer?

Oct 31, 2013

I was wondering if it is possible to measure the total length of lines I have in one layer without using the measure tool on each individual line. In searching other posts a lot of answers reccomend using LISP. Since I am not familiar with LISP at all and haven't purchased the add on is there a simpler way using AutoCAD LT?

View 2 Replies View Related

AutoCAD Inventor :: Sketch Lines Have Perfect Length?

Mar 21, 2013

How can I have sketch lines drawn to perfect lengths. I mean it should be in multiples of 1/16 of an inch.
 
Inventor Professional 2013
Vault Collaboration 2013

View 9 Replies View Related

AutoCAD Inventor :: Sketch Collapse (lines Becoming Zero Length)

Jul 23, 2013

I opened a part today and noticed that it had collapsed into itself.

This should be a rectangle 85x15.75:

On closer inspection it appears that the vertical lines somehow became zero length lines. Why does this happen?

Edit: I should mention that I was able to repair the skecth by making the 85" dimension driven, then dragging the line over...

View 3 Replies View Related

AutoCAD 2013 :: Get The Total Length Of Selected Lines?

Apr 23, 2013

Is there any easy way to get the total length of selected lines (even if they are not "connected") ?

View 6 Replies View Related

AutoCad :: Total Length Of Lines In Complex Plan?

Oct 24, 2011

I have a plan prepared for CNC steel sheet laser cutting. One factor in the costing of the cutting is determined by cutting time or length of cutting. I want to determine the total length of all the lines in a selection so that I can determine what is the most economical design to achieve my goal. Is this possible in ACAD?

View 2 Replies View Related

AutoCad 2D :: Any Command That Actually Splits A Line Into 3 Equal-length Lines?

Jan 23, 2014

I have a line that i would ideally like to divide into 3 equal segments. The divide command places points along the line, but I can't snap to them.

I know that I can place a block at each point which I could snap to, but is there a way of doing it without creating a block? Also is there a command that actually splits a line into 3 equal-length lines?

View 3 Replies View Related

AutoCad :: Dimension Extension Lines Stay The Same Length When Moved

Nov 18, 2012

Some times when I re open a drawing I have been working on, I start to dimension and I notice that the dimension extension lines stay the same length when I move the dimension in and out from the object being dimensioned.

Not sure why this happens, I do all my dimensions in model space, in fact I do just about everything in model and then just set it up in paper space to print.

I never change anything when I start a new drawing in my template, so not sure why it happens.

View 2 Replies View Related

AutoCad :: Angle To Put A Line Of Specific Length Between Parallel Lines

Jun 23, 2012

I am drawing a diagram to describe a mathematical word problem. Since it is easier to visualize with a drawing, I want to draw it using the given dimensions. But angles used in the diagram are unknown and are not needed for the answer to be calculated, so the only way to draw this freehand is to guess at the angle resulting in the correct distances to be off.

Here is the word problem: There are two ladders, one 40 feet and the other 30 feet, each touching the base of one of two buildings and leaning against the other building. If the ladders cross 10 feet above the ground, how far apart are the buildings?

So for my drawing, being rather simple considering what AutoCAD can do, results in this:

Can AutoCAD calculate the angle needed to place a line of a given length between two parallel lines that are a distance apart less than the length of the line to place between them, having the endpoints of this line touching the parallel lines, fitting exactly?

For the word problem, the distance between the two parallel lines is what needs to be solved and the math is quite invloved, having to find the roots or solution of a quartic equation. (I have the solution figured out to be 26.03287754 feet)

What I am afraid of is that this would require to program an AutoLISP routine to create a new command that one can call from the command line. I see it using the the measure command with relative and absolute co-ordinates. This may be far from a "beginner" question. I can do this quite easily on a peice of paper: having two parallel lines drawn, take a ruler and placing the "0" mark on one line, then adjusting the angle until the desired length just reaches the opposite parallel line. I used to use this trick quite often when drafting with pencil and paper to divide a distance into a required number of even amounts, so this can't be that difficult to do with AutoCAD!

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Delete Lines Shorter Than Specify Length

Nov 8, 2002

Is there any utilities that can select the entire drawing with the 2d polyline and erase all the polyline less than specify length (eg:10m,20m etc) ?

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Code Sum Lines Length / Multiplied By Constant

Aug 6, 2013

I have lisp code, which count total length, but I need that it count and multiply by constant which I choose manual (such as in example, total lines yellow length * y + total blue lines * x = ... , example 50*2 + 60 * 3=280), 

remember the another code, such as I have d200 with total l=1000 and d250 with total l=1500, i need to count total cost such as 1000*y+1500*x

one think, diameters numbers is not only 1 or 2, it can be many different diameters.

dwg file here:

[URL]..........

lisp file here:

[URL]........

View 9 Replies View Related

Xara :: Lines Of Fixed Length

Feb 18, 2013

I have an OS plan with the 100 metres squares marked.I want the ruler to coincide with the known 100m length.Then I can mark on layers various lines of say 7m or 25m long.How can I set the ruler and guides to enable me to draw lines such as this.

View 9 Replies View Related

GIMP :: Way To Align All Lines In Order To Make Them Have Same Length

Dec 24, 2011

I notice that in every magazine each line of an article has exactly the same length as the the others despite the fact that there is a different number of words in each line. Moreover, spaces between words change from line to line, according to the amount of words in each one, and as a result every single line has the same length as the ones above and beneath it.In GIMP, when you use textedit (ie this ) you cant do what i mentioned above. Every line ends up in different lenght as each word that does not "fit in the box" goes to the line beneath it thus making a text look kinda ugly.

My question is, is there a way to align all the lines in order to make them have the same length? (just like a magazine would look)

View 7 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 :: 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 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 Dynamic Blocks :: Change Length Of Line Based On Length Of Attribute

Jan 8, 2013

Is it possible to change the length of a line based on the length of an attribute?

I'd like to make the line a MINIMUM length of X" (I haven't decided how long yet--but know I'll need a minimum).  But then after the user fills in the attribute, I'd like the length of the line to change to the length of the attribute plus a small amount (again, I haven't decided yet how much extra).

View 3 Replies View Related

AutoCAD Dynamic Blocks :: Line Length Follow Content Length Of Attribute

Mar 16, 2012

I was wondering if there is a way with DB's to have a line "follow" or "grow" with the content/value length of an attribute. Maybe some method of linking the attribute width to length of the line? Essentially, it would work just like turning on the underline setting when typing in mtext editor (or any program with an underline option for that matter), expect that the line could be placed anywhere, and would not have to reside directly below the text.

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change Length To Match Length

May 24, 2002

Command to make a line change length to match length of a line, arc, polyline or circle? Could use this when making flat patterns layouts.

View 5 Replies View Related

AutoCAD Civil 3D :: Changing Lane Width Not Affecting Resulted Values Of Length And Run Off Length

May 11, 2013

With using superelevation wizard in Civil 3d 2012, changing the lane width is not affecting the resulted values of transion length and run-off length, Is that correct ? ( as civil is using standerd AASHTO tables which assume that lane width typically is 3.6m )

Also, There is only 2 tables for 2-lanes and 4-lanes roadway, Is it for total road width or for one directon only, and what about different no. of lanes ?

View 2 Replies View Related

AutoCad :: Length In Metric Attribute To Automatically Populate Based On Input From Length In Imperial

Jan 24, 2012

I am creating a block with attributes for a standard job. I have (4) total attributes in this block (for example: panel type, qty, length in imperial, length in mertic)

I would like my length in metric attribute to automatically populate based on the input from length in imperial.

Is this possible?

View 1 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 .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







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