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


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: Modify Insertion Point Of Text

Jan 10, 2008

How do I change the insertion point of a text using "vla-put" ? I've tried using :

(vla-put-InsertionPoint en a)) with a = (4455.94 428.576 0.0)

and I get the following error:

lisp value has no coercion to VARIANT with this type: (4455.94 428.576 0.0)

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Find A Block And Get Its Insertion Point?

Jan 27, 2012

How can I find a block with a specific name and get what the coordinates are? What we have is our Bill of Material is attributed blocks. I am attempting to change the first one. Well all of the lines that list the parts are seperate blocks with the same name. Now the Top Line of the Bill of Material is a different named block. If I can find the coordinates of this block I can then select the first line to do what I need to.

If needed: AutoCAD 2013 User using Visual LISP for editing LISP and DCL files Also I have AutoCAD 2011 currently still available for us, but we are using AutoCAD 2013 for 99.9% of AutoCAD use

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Changing Insertion Point Of A Block?

Feb 6, 2011

I have insert blocks in my dwg. It is the circle. While creating the block, i was just pick the point into the circle not exactly at the centre.

Now i want change the insertion point of the block at centre of the circle without moving the objects from the dwg.

Beacuse i had use block editor to change the insertion point. But after changing, all blocks were moved from the original position.

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Multileader Block Insertion Point?

Oct 21, 2013

My multileader style uses a block as a content. How can I find world coordinates of insertion point of block entity within multileaders?

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Rounding Up Block Coordinates (insertion Point)

Sep 2, 2013

We have several AutoCAD drawings with hundreds of block references inserted with imprecise coordinates. Now we need to dimension all elements and need to correct these positions.

I am searching for a routine to round these positions up or down towards a 5mm precision so I don't have to manually move every single block element.

Is there any way to automate the task or do you know any workaround (like inserting the elements into a drawing with poorer unit precision settings)?

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Block Insertion Point Is Within A Closed Polyline

Oct 11, 2011

I've have code to test if the insertion point is within a closed polygon. But prior to testing the insertion point I use ssget to trim the selection set initially..

(ssget "CW" Pnt_List (list (cons 0 "INSERT")(cons 2 BlockName)))

this requires that the whole Crossing Polygon is visible, so I do a zoom first. This requires time. Is there a way I can do this that does not require the zoom?

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Using Insertion Point To Select Line Rather Than Using Entsel

Aug 12, 2013

We have been modifying a trim-around-block routine to have as few clicks as possible and though it feels like we'd be able to have the line to be broken auto-selected based off of the insertionpoint that was set as a variable.

;(setq pnt1 (getvar "lastpoint")
;      sst1 (osnap pnt1 "nea")
;end setq

;(setq ss (ssget '((0 . "LWPOLYLINE")))) ; limited to Polylines
; (while (> (sslength ss) 0) ; as long as there's anything in [or remaining in] the selection set))
; (setq ent (ssname ss 0)
; paramcount 1
; ) ; first entity in [or remaining in] the selection set paramcount 1); end setq
 
are about the closest snippets of code that we've managed to find but neither of these are working.

How we can force the program to break the line without the user having to select the line (because they will have already selected the insertpoint, and using osnap nearest would find the line that requires breaking)

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Zoom Layout (Entities Or Insertion Point Extents)

Oct 12, 2012

I have a drawing with various layouts that when I do a Zoom Extents the drawings is reduced to the size of a point.

I have done all the usual, ie: look for extra entities that are "out in space" so to speak and there are none.

I wonder if I have a block or image which may have an insertion point "out in space" and if this may be the issue.

Is there some way to Select all entities or Blocks (insertion point) that may exist outside a particular area ie: drawing limits.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Leader With No Text

Nov 27, 2011

I'm trying to create a leader with no attachments. Code below. But I can't seem to shut of the Annotation Dialog.

(setvar "cmddia" 0)

(vl-cmdf ".Qleader"     "S"     "A"     "N"     pt1 pt2   ""  )

Also I am trying to create a leader with text that is aligned and above the leader line.

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Have Arrow Leader Convert To Loop Leader In One Click

Jun 1, 2006

Is there a way to have the Arrow leader convert to Loop leader in one click. Our company standards use diamond tags and sometimes i have to change the arrow to loop by inserting a leader.

View 9 Replies View Related

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 :: 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 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 :: Exporting Point Locations To Text File

Jun 8, 2012

Im trying to come up with a lisp that will export x and y coords to a txt or cvs file. However, I need the lisp to export in this format

Units       Inch
WPT      1     0     0     ( X=0 Y=0)
WPT      2     1     1     (X=1  Y=1)
WPT      3     2     2 

I need to be able to set my zero with move origin and the export the points.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Set Basepoint During Insertion Of Blocks

Jan 14, 2013

would like to set a base point during insertion of one block.When not insert by AutoLISP, just type "b" to be able to change the base point.

But when I'm using an AutoLISP that inserts a block, it does not work, it interrupts the sequence of routine.

Lisp:
 
(defun c:carrobox()(setq #clayer (getvar "clayer")) (if (= unidades nil)(setq unidades "cm")).....

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Routine To Substitute Text To Blocks At Point Location

Aug 17, 2012

i found this valuable script Lisp routine to insert blocks at point locations and want to modify it but i do not know much about lisp ...

what i want is :

1) script start and asks for a Block Name (in this case QPP1, QPP2, QS, QE, ect)

2) the user picks existing text  

3) the script reads the value existing on this text an put it in a variable

4) then erases the pre picked text

5) inserts the block chosen

6) changes block value to number value pre-read

since it do almost all steps except for step 3 and 6

View 4 Replies View Related

AutoCAD 2010 :: MLeader Text Moves Insertion Point After Editing?

Nov 28, 2011

AutoCad 2012 SP1 / Windows 7 64 bit

Sometimes I have MLeader text without Mleaders (ie, I remove the leader arm using MLEADEREDIT). Then when I go to edit this 'floating note', the base point moves:

In this screenshot, I've just finished editing the text. Note that I added in the diagonal line at the current insertion point of the Mleader text (top right): 

Then, after I click outside the Mleader box, the text moves:

THis happens only with right-aligned MLeaders, and keeps happening, ie if I edit this text again and close it again, it will move again.

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Select Entity With Options To Type In Text / Pick Point

Nov 6, 2013

I am looking for some code that would allow me to select a MTEXT Entity - or other entity -  (as the DEFAULT option) but also to allow me to type in some text manually or to pick a point in the drawing. Something that would present the user with:

"Select an object or [P to pick a point]"  or

"Select MTEXT or [M to type].

I can write some code to type in text manually as the default option and get the second option to select entity using get string and then write some condition of if code but I don't know how to do it having entsel as default option.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: One Button Changing Text Base Point To Be Middle Center

Aug 23, 2011

how to make a toolbar button so that when i click it and select a few single text, it will automatically change the text base point to be at "MIDDLE CENTER"....

At the moment, i use to create a button with macro of  " ^C^C_text;j;mc "....But the problem is whenever i use this button, i still need to type "MC" at the command prompt.. How to make it so that after i click the button, all i need to to is just select the text..

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: FAILSAFE Basic Block Insertion?

May 20, 2013

I need a function that accepts a block name as an argument and will insert the named block without fail no matter if the block was made to scale uniformly or not.

How can I determine if the block should be inserted like:

(command "-INSERT" blkn "0,0" 1 0)

or:

(command "-INSERT" blkn "0,0" 1 1 0)

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change Block Layer After Insertion

Mar 7, 2013

wondering if is possible to have a lisp routine to:After use the INSERT command, the routine will automatically change the layer of the inserted block to a specific layer according of its name.

i.e.

Step 1 : I will insert a block named Block A using the normal autocad INSERT command (I do not want to insert the block without the Insert window dialog box)

Step 2 : After the insertion, the routine will select the last insertion (or the last object, or any other best way to select this block and will take it's name)

Step 3 : The routine has a list that says:

(If the last insertion (or object) is named Block A, put it in the layer Layer A with color Bylayer and linetype Bylayer)             

(If the last insertion (or object) is named Block B, put it in the layer Layer B with color Bylayer and linetype Bylayer)

and so on... I can make the approprieated list by myself folowing my standards.

I think it will be nice to avoid an error if the block is not in the list. So:

(If the last insertion (or object) name is not in the list, do nothing)

To finish, it will be nice to create the layer if it does not exist. Also, Unlock, Thaw and Turn on the layer if it's Locked, Frozen or Off.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Add Segment To A Leader?

May 11, 2012

I've managed to retrieve the important points of a leader with the following

(setq edata (entget (entlast)))
(setq leader? (cdr (assoc 0 edata)))
(cond
((= leader? "LEADER")())
(T(setq edata (cdr (entget (car (entsel "
Pick a leader: "))))))
)

[code].....

What I'd like to do is add a horizontal segment of a known length to the leader, obviously based on the last point.  I have to assume that the user is in the appropriate UCS for this, but I can trouble shoot for that later.

subst old list iwth a new list and apply it to the entity somehow?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Manage Leader Arrows

Apr 18, 2012

Here's my Lisp routine.
 
(defun c:ll() (errorek) (setq akt_lay(getvar "clayer")) (setq akt_dimldrblk(getvar "dimldrblk")) (setvar "clayer" "ELEMENTS_NO") (setvar "dimldrblk" "_DOTSMALL") (command "qleader") (setvar "clayer" akt_lay) (setvar "dimldrblk" akt_dimldrblk) (setvarki) )
 
(defun setvarki() (setvar "Filedia" filedia) (setvar "osmode" osmode) (setvar "orthomode" orthomode) (setvar "autosnap" autosnap) (setvar "cmdecho" cmdecho) (setvar "dimse1" dimse1) (setvar "dimsd1" dimsd1) (setvar "dimjust" dimjust) (setvar "dimldrblk" dimldrblk) );defun
 
(defun errorek() (setq MojError *error* *error* WlasnaObslugaError filedia(getvar"filedia") osmode(getvar"osmode") orthomode(getvar "orthomode") autosnap(getvar "autosnap") cmdecho(getvar "cmdecho") dimse1(getvar "dimse1") dimsd1(getvar "dimsd1") dimjust(getvar "dimjust") dimldrblk(getvar "dimldrblk") );setq);defun

 What am I going to do?

1. I want to have default leader arrow - "closed filled".

2. In lisp routine from "code 1" I want to put leader (actualy leader without text) with arrow "dotSmall".

3. When I press [Esc] during drawing leader I want to set up back default leader head as "closed filled".

Why my routine doesn't work properly?

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Leader And Block Count

Nov 29, 2011

I am looking to modify a block count lisp, the lisp counts the blocks and displays them in the command line. I am looking to take that list and insert it in to a leader.

So it will prompt me to select blocks.

1st Point of leader
2nd point of leader

and would generate the block list in the leader annotation.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Attach Leader To Existing Block

Oct 24, 2013

Is there a way to attached an already exisiting placed block to a leader. If so, is there a way to do it to all the existing blocks, that are of the same block definintion, at once?

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Convert Spline To Curved Leader?

Sep 21, 2004

Code to convert a spline or read its points so I can create a curved leader (with arrowhead) reasonably close ?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Simple Program That Changes Color Of M-leader Lines?

Mar 19, 2013

have a simple lisp (no v.b.) program that changes the color of m-leader lines in acad 2010?

IV 2010 Suite
Digital Storm PC:
EVGA & Intel components
Win 7 Pro 64 bit

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







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