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


ADVERTISEMENT

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 :: 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 :: Add Or Subtract To Modify Value In Text String

Oct 18, 2011

I need a lisp routine that will add or subtract to modify a value in a text string. Its used for drainage fixture units on waste & vent plans. Example: We use basic dtext strings that look like this [color=red]4"(6)[/color]I would like to be able to add or subtract to the number that is [b][size=12pt]ONLY[/size][/b] in parenthesis and would like to be able to pick multiple text strings at one time so it would result in something like this: [color=green]4"(6)[/color] + 9 will become [color=blue]4"(15)[/color].

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Modify Dim Text Color In Current Dimstyle

Jun 27, 2012

How to change the dim text color in current dimstyle with a lisp routine? I want to modify current dimstyle instead of override current dimstyle, so it can change all existing dim text color under the current dimstyle.

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 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 Civil 3D :: Modify Point Label Style Using Visual Lisp

Feb 19, 2013

I am having trouble drilling down to the object that contains the point label components.  Specifically, I would like to access values such as Anchor Component, Anchor Point, Text Height, X Offest, and Y Offset for the various components of the Point Label Style.  I am able to get the Point Label Style by name (object dump below) but I don't know how to get at the components that I want to work with.

; IAeccPointStyle: IAeccPointStyle Interface; Property values:; Application (RO) = #<VLA-OBJECT IAeccApplication 000000004965fbc0>; CreatedBy = "Cooper"; CustomMarkerStyle = 0; CustomMarkerSuperimposeStyle = 0; DateCreated (RO) =

[Code]....

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Add / Modify And Remove Registry Key?

Feb 27, 2012

Some time ago I was able to add modyfy and remove regestry keys ussing AutoLISP Unfortunatly I have lost the information on how to do this.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Modify Hatch Code

Aug 20, 2013

Modify the attached lisp I found in this forum to work using a different hatch pattern, scale and angle.  The new hatch should be in default Autocad "LINE" pattern and angle set to 90 degrees (vertical). If possible, I would like the angle and scale to be editable.  Find attached Multi_Hatch-45 code posted by CADaStroumph in 2008.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Modify Existing Selection Set?

Sep 5, 2012

I need the same funcionality as in code below, but without using "command".

The main idea is alowed user to modify Existing Selection Set.

 (defun gt:ss->lst (a:ss / i lst ) ;_ / (setq i 0) (if a:ss (progn (repeat (sslength a:ss) (setq lst (cons (ssname a:ss i) lst) i (1+ i) ) ;_ setq ) ;_ repeat (reverse lst) ) ;_ progn ) ;_ if) ;_ defun gt:ss->lst(defun gt:ss_modify (a:en-lst / ) ;_ / ;;create Selection set (setq ss2 (ssadd)) (foreach f:en a:en-lst (ssadd f:en ss2) ) ;_ foreach ;;Run command and fill with initial content (command "_select" ss2) ;;Alow the user to modify the contents (while (/= (getvar "cmdnames") "") (command pause) ) ;_ while ;;get back the list of enames from modified selection set (setq ss3 (ssget "_P")) (setq ss3-lst (gt:ss->lst ss3))) ;_ defun gt:ss_modify(defun tst:gt:ss_modify ( / ) ;_ / (gt:ss_modify (gt:ss->lst (ssget)))) ;_ defum tst:gt:ss_modify

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Modify Line Inside A Block

May 20, 2013

I have a simple block with 2 attribute and 1 line inside it.

something like this:

Attribute1

──────

Attribute2

I want to modify length of line due to width of thoes attributs. length of line is equal to maximum(width attribute1 and width attribute2).

dxf code for start point of a line is 10 and end point for a line entity is 11.The question is: how can I modify the length of line automatically via maximum width of these attributes?

for getting width of a text:

(defun GetWidth ( en ) ((lambda ( lst ) (- (caadr lst) (caar lst))) (textbox en)))
sample:

A1
──────                    
Attribute2

Attribute1
──────           
A2

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Modify Properties On Multiple Drawings

Nov 6, 2012

Any lisp routine on how to change "Drawing Properties" (fields via Mtext) on multiple single drawing files?

There are several instances where we would need to take a project to create another one and simply change the title block description.

As of now, we are opening each drawing (there could be hundreds) and modifiying the drawing properties on each drawing to change the customer name and other project descriptions.

These are not attributes, but fields. I've researched alot on here and couldnt find anything.

The drawing is attached.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Modify Table Column Widths

Apr 26, 2012

How to modify the column widths of an ACAD_TABLE?

I have known co-ordinates that I want each grip for the table to be set at.  I can't just copy and paste the table from drawing to drawing.  Each table of each drawing have different textual values, and the column widths will best be sized for each text value.

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Modify The Existing Parametric Parameters?

May 2, 2013

Is there a way to modify the existing Parametric Parameters that are in the Parameters Manager using LISP?

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Modify Objects Copied From A Selection Set?

Nov 17, 2011

I am creating a selection set using ssget...

Then I copy that selection set multiple times in a loop.  What I would like to do is then rotate (or otherwise modify) the last copied group of items.  If I rotate "last" it will only accept the last drawn item, so only one item in the group of copied objects will rotate.

Here is the portion of simple code I am using right now (it's in a loop so all variables with 'Next' are changing each time):

(command "_.copy" SS1 "" SS1Base NextPT)
(command "_.Rotate" "l" "" NextPT NextAng)

This works fine with a single object, but I can't figure out how to call up the entire group of objects.

Civil 3D 2011
Windows 7 x64

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Modify Property - Insert Polyline As Block

Sep 22, 2011

I am starting with a polyline then i use the pasteblock command to insert that polyline as a block.Now i can pull up the property box and change the xyz scale.

I would like to know how to change these setting in my lisp.The scale will be x=1 y=0.1 z=1

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Insert Dynamic Block And Modify Stretch Points

Nov 30, 2010

I have a dynamic block that I would like to insert via a lisp routine. When the routine is run from my menu I would like to select two points on the drawing area. Then I would like my dynamic block to be inserted at one of the points I selected and then I would like a specific "point" of my block to be stretched to the other point that I selected. I was wondering if this is possible with LISP? I have my old LISP program I wrote that draws a leader and then inserts my block but that was before I started working with dynamic blocks.

Here is my current

(defun c:wldsym()
(setq osnapold (getvar "osmode"))
(setq orthold (getvar "orthomode"))
(setq dimsc (getvar "dimscale"))
[code]...........  
  
wld1r.dwg is my current block. It has some dynamic properties already. But I'm trying to add new properties that can be seen in my working test drawing wld1r-new.dwg

When using my code with "wld1r.dwg" you can see how everything behaves right now. Then open "wld1r-new.dwg" and note that the insertion point and a stretch point my default are in the same spot. Work with the two stretch points and look at how the block reacts.

View 9 Replies View Related

AutoCAD 2010 :: Modify Insertion Point For Existing Block Definition

Jun 16, 2011

I have several existing block definitions and need to change the insertion point. Also, when creating a new block in the Block Editor, how do I define the insertion point?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Block Insertion Routine Based On Block File Name

Apr 5, 2013

Create a routine that looks for a block based on a portion of that block name, using a specified path or search path. 

For example, block to search for is BLOCKABC123, so if someone inputs ABC or 123 as a block name, it will locate that block within that folder and inserts it into the drawing at a user specified location.

Ideally, if there is a check in that if it finds more than one match, then perhaps it flags or prompts you to choose 1, 2, or 3 option which block to use.  But I can live without this special function if it requires too much time to code.

View 8 Replies View Related







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