AutoCAD Visual LISP / AutoLISP :: How To Put Multi-lines Of Text Into Drawing Info Comments

Dec 19, 2011

I am able to insert multi line text into the Drawing Properties Summaryinfo standard field "comments" by using  string concatenation in VBA by using "mytext" & vbLF & vbCR "mytext".

But I can't find a way that works in autolisp. This code does not work.
 
(defun c:FillComments (/) (vl-load-com) (setq acadObj (vlax-get-acad-object)) (setq acDoc (vlax-get-property acadObj 'ActiveDocument)) (setq acDocSumInfo (vlax-get-property acDoc 'SummaryInfo)) (setq *customer* "MyCustomerName") (setq *location* "MyLocation") (setq *project* "MyProject") (setq*comments* (strcat *customer* ", " (chr 10) (chr 13) *location* ", " (chr 10) (chr 13) *project* ) ;_ end of strcat ) ;_ end of setq (vlax-put-property acDocSumInfo "Comments" *comments*) (princ)) ;_ end of defun
 
The text comes in but all on one line.

View 3 Replies


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: Placing Multi Lines Of Text In DCL Edit_box

Jan 10, 2012

Is it possible to have Multi lines of text in a .dcl edit_box or such? 

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Construct Lines Between Lines Ending Points Multi Selection?

Aug 3, 2013

I want to construct lines between every two line ending point by multi selectio window instead of drawing it manually between lines ending point ?

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Editing Multi Leader Text Insertion Point

Nov 16, 2012

Is there a way to modify the text insertion point of multileaders using lisp? We have a problem with some of our multileaders getting a landing distance set to a negative value.  My lisp routine will correct these to a default value, but then the text jumps a bit.  If I could get the insertion point prior to changing the landing distance then I could restore that point after changing the landing distance.
 
;;-------------------------------------------------------------------------------------------------(defun c:zld (/ e th dogleg doglegllength sf ss c mlss mlcount) (setqss (ssget (ssget "X" (list (cons 0 "MULTILEADER"))))DWATxtHgt (getvar "userr1")sf 1dogleg (/ 3 32.0)th (if dwatxthgt dwatxthgt dogleg)c 0mlcount 0mlss (ssadd)) (IF ss (while (< c (sslength ss)) (setq e (vlax-ename->vla-object (ssname ss c)) c (1+ c) ) (= (vla-get-ObjectName e) "AcDbMLeader") (progn;;change the dogleglength if

[code].......

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Sorting Multi Line Text In Alphabetic Order

Apr 23, 2013

I required a lisp for sorting Multiline text in alphabetic order. (Ascending and Descending)

For example in my drawing it contains lot of Mtexts having multi rows. I need to sort texts inside Mtext. Like PDC-012, DAG-012, AAG-096. I need that Mtext should be AAG-096,DAG-012,PDC-012.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Use It For Drawing Lines Between Two Points

Aug 19, 2013

how to use AutoLISP to draw lines between two points. I have x,y,z coordinates for the end points in an excel sheet which I can save as a text file. I need to pull the coordinates from the file and use them to draw the lines. There are 2000+ lines so it is not feasible to draw them manually.

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Drawing Rectangle Between Lines

Aug 9, 2013

I need lisp that draws rectangle between two lines by window selection. As attached.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Drawing Two Different Lines Over Each Other In One Step

Dec 5, 2011

I want to draw a line which shows a particular color scheme, I at current do this by drawing a solid line of one color and then use a dashed line of another color top go over it.

The obvious problem is that these lines are being double drawn. Is there a way using lisp that I can draw both lines at once?

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Two Lines In Drawing - How To Flatten

Jun 19, 2013

There are two lines in attached drawing. It seems FLATTEN doesn't work on them. How can I flatten them with lisp code?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Using TEXT Not MTEXT To Create Multiple Lines Of Text?

Oct 4, 2011

3rd party tool which didn't match our scaling needs the file is a fas so I have tried to reverse engineer the whole function using trial and error. The following code works perfect except we need multiple (x amount) lines of text I have at current the M txt function which mimics and is effective for today however we need all lines to be individual.

I’m playing round with a loop but how to achieve my need..He had a 3rd party tool which didn't match our scaling needs the file is a fas so I have tried to reverse engineer the whole function using trial and error.

The following code works perfect except we need multiple (x amount) lines of text I have at current the M txt function which mimics and is effective for today however we need all lines to be individual.
 
;Starting lisp program...(defun C:REDtext ();Creating Layers (if non existant)...(command "layer" "m" "TEKST-1.5mm" "lt" "continuous" "" "c" "1" "" "");Memorising previous layer...(setq MYOLDLAYER (getvar "clayer"));Setting requierd layer...(COMMAND "LAYER" "SET" "TEKST-1.5mm" "");Setting variable "MYHEIGHT" to "DIMSCALE" x 2...(setq myheight (* 2 (getvar "DIMSCALE" )));Requesting and storing usser defind point...(setq MYPOINT (getpoint "Start punt :")); Requesting and storing user defind text...(setq MYTEXT (getstring T "Nieuw tekst :"));Placing text...(command "text" MYPOINT MYHEIGHT "0" MYTEXT); Restoring previous layer...(setvar "clayer" MYOLDLAYER);Closing lisp program...)

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Go From TEXT And LINES To TABLE?

May 6, 2009

The PARTS LISTS on our old drawings are simply text entities and lines. Some are MTEXT. But our new drawing template has us creating our parts list using the actual AutoCAD TABLES entity.

I'm looking for the best method to go from lines and text in AutoCAD, to an AutoCAD table. As of now, I have to retype everything since I can't select a column/row or group of text entities, copy/paste into a table.

Any LISP function that will allow me to go from TEXT and LINES to a TABLE? I've tried B2E (lisp name) but it's not working - found that on a lisp site somewhere.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Write Several Lines Of Text To TXT File?

Apr 13, 2012

I know how to write a single line of text to a txt file with LISP, but how do i write two or more lines of text to a txt file ussing lisp?

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Add Text To All Dtext In A Drawing

Oct 7, 2011

Any lisp routine out there to append (prefix) text to dtext?

i have 100s of dtext that has numbers in them, and i need to place the "#" symbol in front of them now.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Layer Name And Description As Text In The Drawing?

Nov 14, 2013

is it possible to make a LISP program whcih write down my layer name and description as text or Mtext in the drawing, so it will look like:

A_Wall architecture wall

A_Column architecture column

something like that.Each text, which is written in the drawing should have the same layer like the layer name.

the closest i can get is this code below, which write the layer as text, but what missing is: i want to add the description behind the layer name:

(defun c:layerlegend (/ osm ortho clayer celtype cecolor start-point line-length text-height *error*)
(defun *error* (msg)
(setvar "osmode" osm)
(setvar "orthomode" ortho)
(setvar "clayer" clayer)
(setvar "celtype" celtype)
(setvar "cecolor" cecolor)
(princ msg)
)

[code]...

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Display Variable Value As Text On Drawing Window

Jun 14, 2013

I am writing a LISP program to generate development of surfaces. Once the entire drawing is completed, I want that the input data to be displayed on drawing window as text.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Grab All Text In Drawing - Incrementing Variables

Aug 1, 2013

I have this lisp that grabs all the text(the value and the location) in my drawings and I put them into a list.  Here is what I have so far:

(defun c:loop ()
(setq numbers (ssget "_X" (list (cons 0 "TEXT") (cons 1 "##*")) ))
(setq newlist '())
(setq IN 0);set index
(setq SLGTH (sslength numbers))
[code].......   

What i need to happen is this:  When "whatever" returns "value0" i need to set "value0" to the first item in list "newlist".  Then when "whatever" returns "value1" i need to set "value1" to the second item.  Now I can do it the long hand way, but i am trying to simplify this step, and shorten up my overall program.

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Large Drawing - Reverse Bearing Text

Oct 1, 2012

I have quite a large drawing (subdivision) with many bearings annotated.On many of the bearings, I wish to reverse them.

For example, if the text is 6°49' I want it to read 186°49'

Similarly if the text is 355°21' I want it to read 175°21'

Any LISP routine or VBA that will do this?I have one called "180" however it only succeeds in crashing Autocad.

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 :: Multi Change Layer

Feb 6, 2012

I have the following Lisp command that changes a selected layer to a different layer. I have tried modifying it change known layer names to different known layer names. i.e run routine and it changes layer "2" to "3" then changes layer "dim" to "dims" ect then stops.

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Multi-line Tooltip For Icons?

Feb 24, 2013

I have some my own Icons on my Toolbar in Autocad that prepared by myself,

I can define tooltip for those icons by "Description" property of icons in CUI.

but the limitation is: I will have just single-line and simple tooltips!

so, how can I define multi-line tooltips for my own icons? or even graphical tooltip?!

should I use "Zammel" language? 

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Entmake Insert With Multi Line Attributes

Aug 30, 2012

I want to entmake a block with a multiline attribute. Entmaking the block definition works fine, but what do I code for the Multiline Attribute? Should it be coded (0 . "MTEXT") instead of (0 . "ATTRIB")? I know (101 . "Embedded Object") does not work. What other codes need to be included?

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Attributed Multi Block Insert From Custom DCL

Dec 27, 2011

I have been working on an AutoLISP routine which is intended to:

1) collect input from the user via a DCl dialog box

a) Create a List of the non-null "GROUP_CODE..." variable values collected from the dialog's settings

b) Create a List of the "ESN***#_Part" variable values collected from the dialog's settings (does the List elements' order need to be reversed after collecting them?)

2) Prompt the user to select an insertion point

3) Insert a Block named "ESN-CONTROL-WIRED" which has multiple attributes

a) Apply the first List element collected at step 1.a above to the attribute tag "INPUT_ADD" in the block

b) Apply the first List element collected at step 1.b above to the Attribute Tag "PART_NUMBER" in the block

4) Insert a second instance of the Block named "ESN-CONTROL-WIRED" below the first instance

a) Apply the second List element collected at step 1.a above to the attribute tag "INPUT_ADD" in the block

b) Apply the second List element collected at step 1.b above to the Attribute Tag "PART_NUMBER" in the block etc. .... keep inserting the block "ESN-CONTROL-WIRED" below the previous on until all the input from the dialog has been displayed in the attributes. 

Notes:

The Dialog's pop-up lists are populated from external .TXT files which reside on our network (or alternate local C: drive folder if no network drive is found)

Inside the file "ESN_SENSORS_NUMBER.LSP", it is the function "ESN_APPLY_TAG" which I am struggling with how to write...

find inside the .ZIP file:

- (2) example screenshot .BMPs showing dialog box settings and what the resulting output in AutoCAD should look like

- (1) ESN_SENSORS_NUMBER.LSP

- (1) ESN_SENSORS_NUMBER.DCL

- (1) ESN_SENSORS_NUMBER.DWG with a sample output - and the definition of the block ESN-CONTROL-WIRED

- (1) ESN-OCC.txt  which populates the PopUp List Boxes

- (1) ESN-DAYLT.txt which populates the PopUp List Boxes

- (1) ESN-IR.txt which populates the PopUp List Boxes

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Intersect Between Two Lines Using Start And End Values Of Two Lines

Oct 11, 2013

With all of you fine teachers, I have the know-how to get the start and end values of a line.

Do you think there is a way to get a point returned that represents the true intersection of the two lines, without having to involke a user defined "getpoint" function using "intersect" osnap?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Saveas Drawing With Default Drawing Name

Oct 13, 2013

I am trying to put together a lisp routine for exporting a Civil3D drawing to basic autocad entities and convert it to a clients layer standards.

I don't want any user input, so I see two problems with the routine at the moment.

Step 2. SAVEAS - I want the drawing to be saved in the same directory as the current drawing, either called "CLIENT_export.dwg" or preferably "Export_{current drawing name}.dwg". If the dwg exists I want it either to overwrite or increment a suffix number.

Step 4. At the moment it askes the user for a selection, I want it to select "ALL"

;;;Purpose to convert a Civil3D drawing into CLIENT layer standards.

(defun c:client ()
(setq old-echo (getvar "CMDECHO"))
(setvar "cmdecho" 1)

[Code]...

I don't have any experience with LISP or any other programming. I have just been cobbling this together from bits and pieces I have found on the web.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Line Between Two Lines?

Feb 15, 2013

I am trying to draw a line between two lines and I put together the following. It works great if the start/end points are perpendicular to each other. How do I solve if line one start point is in a positive direction and line two is in a negative direction? 

(defun c:test ()
 (setq L1 (car (entsel "
Select the first line: "))
L2 (car (entsel "
Select the second line: "))
 )

[code]....

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Available For Angle Between Two Lines?

Nov 28, 2011

i know DIMANGULAR command will let me draw a dimension to display the angle between two lines, but is there a way for my commandbar to show me what the angle is rather than draw a dimension?

I often want to simply know the angle but not display it in the drawing, and it'd be good if there was a command/lisp which showed me in the command line area, or perhaps a pop up window, similar to what the TLEN lisp does here: URL....

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Get Min Max Coordinates Of A Set Of Lines

Dec 5, 2013

I want to get the minimum and maximum x, y coordinate values of selected lines. In other words, i want to find the top, bottom, left and right edges of a set of lines.

Is it possible to achieve this with a lisp code?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Insert Another Drawing Layout Tabs Contents In Current Drawing

Mar 7, 2013

I want to insert another drawing layout tabs contents in current drawing.

It's easy for MODEL tab, but for LAYOUT tabs, I dont know how!?

I prepared a code for INSERTING MODEL tab in current drawing:
 
(defun INS_DWG (TAB path dwg P / blk)(setq blk (strcat ""*" path dwg """));(setq N (vla-get-count (vla-get-layouts)));;Number of LAYOUT TABS in dwg(if (or(= TAB 0) (= TAB nil))(command "INSERT" blk P 1 0)); TAB=0 or omitted ==>Insert MODEL;(if (= TAB 1));==>Insert the 1st LAYOUT in dwg file;(if (= TAB 2));==>Insert the 2nd LAYOUT in dwg file;and so on....);;;usage:;;(INS_DWG 0 "c:\test\" "test.dwg" '(0 0))

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Multiple Mirroring Lines

Aug 27, 2013

Project involves repeatedly mirroring a line by selecting mutiple lines to do the mirroring. Probably sounds confusing.

The progress so far can be found here: [URL] ........

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Labeling Lines With Lengths

Mar 2, 2012

Labeling lines with their lengths,

I got the attached lisp file from the web which automatically labels the lines with their length. Resulting the values of the length in the absolute values of the length instead of saying that the length is in inch. i.e, i  need to remove the inch sign (") from the suffix of the length.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Line In The Middle Of Four Lines

Aug 10, 2013

I need lisp that do a line between 4 lines. 

View 7 Replies View Related







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