AutoCAD Visual LISP / AutoLISP :: Routine Required To Replace / Place Block On Each Closed Polyline?

Mar 26, 2012

Does any Lisp routine available to batch replace all the closed polylines with an existing block?

View 9 Replies


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: Closed Polyline And Place Mtext With The Room Name And Area In M2

Oct 24, 2013

LSP file i downlaoded from web.it is to use for Area with (m2) and room name. by click polyline.

i want to modify it to use without adding Room Name, just insert area to the drawing.

(defun drtxt (/ rn tx ls vl lt ht lb hb nr pt)
  (setq tx (strcat "Area: "
       (rtos (/ (getvar "area") 1000000) 2 2)
       " m2"
       )         
       rn (getstring "
Room Name: ")

[code]....

View 5 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 :: Routine To Replace All Blocks

Oct 5, 2011

I am looking for a routine that will replace all blocks named "DgnMisc_nodepoleind" with a block named "DgnMisc_nodepoleind2" keeping the insertion point. I could use (command "-insert" "DgnMisc_nodepoleind=Y:/ACAD2007/DA settings/Library_new_scale1/DgnMisc_nodepoleind2.dwg" NIL ) but my problem is that the block I want to replace is used on two different layers and I only want to replace the ones on layer "TPSYM01".

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Routine To Place Lights In Room Evenly?

Jan 13, 2013

Lisp routine that divided up a normal square / rectangle room and insert a block at each given point.

At present if the room was to have four lights width ways and three lights length ways we would divide the width by eight to give us 1/2 1 1 1/2 so the lights would be placed on every second point after the divde command (dividing the room by twice the amound of lights needed). 

View 9 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 :: Auto Dimension Closed Polyline

Mar 8, 2013

Is there a command or a lisp that will automatically dimension each side of a closed polyline at once? See attachment for image. 

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Create Closed Polyline And Convert It To Region

Oct 9, 2013

I'm trying to look for a LISP command where i will create a closed polyline with 4 sides in different angles. then convert it to region. 

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

AutoCAD Visual LISP / AutoLISP :: Routine For Replacing Line With Block?

May 21, 2012

Lisp Routine that could replace a line at a specified maximum length with a block at the lines midpoint.

I would love to be able to replace all lines I select which are say less than 0.5m in length with a block at the lines.

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Block Attribute Update Routine

Nov 3, 2011

I'm trying to find a routine that will look for ABC block and updates its NUM attributes depending on what's shown in the DESC attribute.  There are about 5 of these ABC blocks in a drawing.  Block ABC has 2 sets of attributes: DESC and NUM. 

When run, it will look at the value of tag DESC, if it contains value XXX, then it will change the NUM value to 1111.  And if DESC contains value YYY, then it will change the NUM value to 2222.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Place Aligned Dimensions On Each Segment Of Polyline?

Feb 6, 2006

Have Lisp to place aligned dimensions on each segment of a polyline?

I would use it for reinforcing bar detailing.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Routine Measure Command And Block Attribute Value?

Nov 28, 2011

I am trying to create a lisp that prompts you to select multiple lines, and then prompts to enter a name of a block you wish to use. With that information use the measure command to place the entered block along the selected lines with the spacing set to the value in the blocks attribute.

I have a lisp that does most of this with the exception of the extracting the value of the block size to use as the distance between blocks, the current lisp just prompts for the distance.

I have a lot of blocks with different spacing so it is hard to remember the distance.

Here is the current Lisp i use:

(defun c:MEB (/ blk ss l name)
; TharwaT 04. 04. 2011
(if

[Code].....

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Routine To Change Company Logo From One Block To Another?

Apr 17, 2012

We are trying to update our company logo on hundreds of autocad drawings, any lisp routine or a better way to get this updated. We are trying to update our title blocks that have company logo in it and want to change the logos to the new one.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Routine That Automatically Inserts Parameter In Block

Apr 26, 2012

I am working on a lisp routine that automatically inserts a parameter in a block and then ads a stretch command to it. But the problem is that for the stretch command u need to select the drawn parameter. So my plan was to get the name of this parameter (car (entsel)) and feet it to my lisp program. But when i do that it doesn't work because autocad demands a parameter. 

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Replace Nested Block

Aug 7, 2012

I have a dynamic block that has a nested temporary block inside it. What I am wanting to do is replace the temporary block with the permanent block. I have tried several different variation of coding but I cannot seem to get this bad boy to work. have used:

(vla-put-name (vla-item (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object)))) "tempBlockName") "newBlockName")

this gives me a duplicate names error. 

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Attribute Height Is Changing Each Time Routine Is Run With An Annotative Block

Apr 30, 2012

I only do programming when absolutely needed so it usually only happens every couple years. I wrote this routine to count nested blocks inside of dynamic blocks to count parking spaces. The routine worked fine but was relying on the ltscale to scale a block containing an attribute for the total number of spaces. I want to update the routine to use an annotative block so the scale doesn't have to be set. I changed my block containing the attribute but now when I run my routine, the attribute height gets changed each time the routine is run. The text just gets larger and larger. Here is the portion of the routine where the attribute info is gathered and updated with the new value for that attribute. If you need the entire routine, I can post it with a slight modification so it will work outside our network.

(defun updateattrib ()
(setq CNT 0) ; sets count to 0
(while (< CNT (sslength ss)) ; starts loop while CNT is less than the number of objects in the group

[Code].....

I am running this in Civil 3D 2010 but will want it to work in 2013 so if the solution will only work in 2013, that is fine with me.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Modifying A Replace Block Script

Nov 26, 2012

Is there a way to modify this script so you don't have to manually choose the blocks. Instead have it find all block names starting with "Supply Diffuser 24x24" and replace them with a block in the drawing named V01.
 
(defun C:CHANGEBLOCKS(/ printDebug ssAll ssAllTotal ss ssTotal ssCount ssCount2 ssTotal ssMainBlock ssMainBlock entListMainBlock ssBlocks entListBlock entListBlock2 entElementNewBlock entElementOldBlock entElementOldBlock2 oldBlockName) ;PROGRAM CHANGES MULTIPLE BLOCKS ;WRITTEN BY --- RAUL BENITEZ ;Command reference ;subst - returns a list with a new item substituted for every occurrence of an old item ;quote (or ') - easy way to make the string into a list. ;cdr - returns a list containing all but the first element of
[code].......

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Replace Block On Different Layers With Different Blocks

Jun 20, 2012

I was able to write a LISP that replaced each node with a block of my choice.However, now I need to find a way now to replace the blocks with different blocks.Each point shares the exact same block called "PILE". Different blocks are on different layers and have 11 different colors. I'd like to replace blocks on layer 1 with a block called "1" and blocks on layer 2 with a block called "2" and so on.I was hoping there would be an easy way to do this in LISP, but I've been unable to get any of my scripts to work.

I've attached a link that visualize what my drawing is currently looking like: [URL] ......

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Link Attributed Block With Polyline To Get Area

Sep 13, 2013

I'd like to set up a blockwith different attributes like Roomname, Floor, Area,...

Therefore I'd like to link a polyline of the drawing with the block and it shows me its area. I know how it works with fields, but not how to connect it when the field is within a block.

Is there a LISP for that?

View 4 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 :: Write A Lisp Routine That Invoke The Mleader Command

Oct 11, 2012

I'm trying to write a lisp routine that, when I invoke the mleader command, osmode is set to "nearest" & orthomode is set off. I then would like the original settings to be returned.

attached is what I have written so far:-

View 4 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 Visual LISP / AutoLISP :: Stuck In A Routine 2?

Nov 21, 2013

Basically, the routine asks for the user to choose the hatch type (Retirer/Percer), then the layer (Defpoints/Select/Current) and finaly the type of the object to draw (Polyline/Rectangle). My original routine has also a Circle and a Boundary options, and an Error trap to reset the variables but I will keep it simple for the purpose of my issue. 

So, my issue is: when I choose the type of object to draw, it draws just one of it and the routine ends. I would like to have something that "says" to the routine that I want to keep drawing that object (Polyline or Rectangle) and putting the hacth inside until I do enter and then the routine goes to its end.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Force A Routine To Be Run

Dec 10, 2012

I have created an acad.lsp file in where I want to arrange all our company settings. I've stored it on the network to make sure everyone will use the same one and when updates take place I don't have to run past all pc's to change it. I've set everything in the deployment package but users can still change it when they reset their profile. Plus some pc's are already installed with AutoCAD before creating the lisp routine, how can I enforce the support directory to check on the network for the acad.lsp each time?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Use Selection Set For Routine?

Oct 16, 2013

with the mouse I can select objects on the screen and then start a command that uses these objects.

How can I perform this in lisp?

I can create my selection set, that's no problem, but how can I 'make it active'  for an external function?

(ssget "_C" p0 p1 '((0 . "TEXT")))
???
(c:txtexp)

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Routine To Check Overlap

Aug 12, 2012

I want autolisp program to check overlap like in closed or open polyline with any other entity in the drawing, whether other entity is overlapping inside the polyline or not, i am beginner in autolisp and want to know exactly which functions are used or the program itself Also if possible to check circular overlap of one polyline with itself.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Routine For Rotating Lines

Jul 23, 2013

LISP routine for rotating lines so that text in linetypes always reads from left to right?

I use the QUERY command to create basemaps and often the lines that are imported read upside down or backwards or however you prefer to look at it.  Most often, if I look at the XY coords of these backwards lines, the End X coordinate is of a higher value than the Start X coordinate.

Looking for something that would compare the two X coordinates of a line, do some sort of an IF Start X > End X, and if its true, store the XYZ coords of the Start and End in some variable, and swap them.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Routine For Page Setup

Jan 9, 2013

I found a lisp routine on the internet to change page setups on multiple layouts. The lisp worked but on some of the layouts it moved the viewport off the paper background (see attached). The layouts print fine but the only way to get the viewport back on to the background is to open the page setup and click modify, then ok and close. I tested this on a .dwg that I had saved to my computer rather than on one in  the main folder but I would like to do this to to all are maps since our IT decided to rename our printer and now all pages setups are no good.All I know about lisp is how to run one.

;; Copy current layout page setup to all layout tabs
(vl-load-com)
(defun c:CPS (/ Adoc Layts clyt)
  (setq aDoc  (vla-get-activedocument (vlax-get-acad-object))
 Layts (vla-get-layouts aDoc)
 clyt  (vla-get-activelayout aDoc)
  )
  (foreach
     itm
        (vl-remove (vla-get-name clyt) (layoutlist))
    (vla-copyfrom (vla-item Layts itm) clyt)
  )
  (princ)
)

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Inserting Routine Into Fields

Sep 4, 2012

I have a lisp routine:

(defun getLayout (pos / result cLayout layouts^ i len)
; pos = -1 return previuous layout name
; pos =  0 return current   layout name
; pos =  1 return next      layout name
 (cond
  ((zerop pos)
   (setq result (getvar "ctab"))
  ); case

[code]...

which basically returns either the current, previous or next tab name depending on what you call up. Any way to link this lisp to a field? I am doing some plan and profile drawings which contain match lines I would like to have the match line text automated. For example if I'm on layout called PP02 there would be two match lines in the drawing one would read MATCH LINE PP01 and the other would read MATCH LINE PP03 this lisp routine returns the correct variable but how do I loink this to a fiels?

View 1 Replies View Related







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