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


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: Entmake A Hatch Entity From A Hatch Template?

May 2, 2013

I am trying to entmake a hatch entity from a hatch template.

After entget the template hatch entity, i get the followings

Select object: ((-1 . <Entity name: 7ed11b78>) (0 . "HATCH") (330 . <Entity
name: 7efc7c10>) (5 . "737") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 .
"SECTION-LABEL") (62 . 255) (100 . "AcDbHatch") (10 0.0 0.0 0.0) (210 0.0 0.0
1.0) (2 . "SOLID") (70 . 1) (71 . 0) (91 . 1) (92 . 1) (93 . 8) (72 . 1) (10
633596.0 5.79713e+006 0.0) (11 633519.0 5.79713e+006 0.0) (72 . 1) (10 633519.0
5.79713e+006 0.0) (11 633519.0 5.79708e+006 0.0) (72 . 1) (10 633519.0
5.79708e+006 0.0) (11 633500.0 5.79708e+006 0.0) (72 . 1) (10 633500.0

[code]....

Now I  wrote the following code using the above data as follows

(entmake (list (cons 0 "HATCH") (cons 67 0) (cons 410 "Model") (cons 8 "SECTION-LABEL") (cons 62 255) (cons 10 (list 0.0 0.0 0.0)) (cons 210 (list 0.0 0.0 1.0)) (cons 2 "SOLID") (cons 70 1) (cons 71 0) (cons 91 1) (cons 92 1) (cons 93 8) (cons 72 1) (cons 10 pt1) (cons 11 pt2) (cons 72 1) (cons 10 pt2) (cons 11 pt3) (cons 72 1) (cons 10 pt3) (cons 11 pt4) (cons 72 1) (cons 10 pt4) (cons 11 pt5) (cons 72 1) (cons 10 pt5) (cons 11 pt6) (cons 72 1) (cons 10 pt6) (cons 11 pt7) (cons 72 1) (cons 10 pt7) (cons 11 pt8) (cons 72 1) (cons 10 pt8) (cons 11 pt1) (cons 97 0) (cons 75 0) (cons 76 1) (cons 98 1) (cons 10 (list 0.0 0.0 0.0)) (cons 450 0) (cons 451 0) (cons 460 0.0) (cons 461 0.0) (cons 452 1) (cons 462 1.0) (cons 453 2) (cons 463 0.0) (cons 63 5) (cons 421 255) (cons 463 1.0) (cons 63 7) (cons 470 "LINEAR")))

The point variables pt1, pt2....pt8 are all defined. But when I run the code the hatch is not being created? Why?

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Automatically Pick Up All Hatch And Solid Hatch Patterns

Aug 6, 2008

I am in need of a lisp routine which will automatically pick up all hatch and solid hatch patterns within a drawing and change the colour to colour 254.

View 9 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 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 :: 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 :: 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 :: 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 :: DXF Code For Inverted Xclip?

Apr 3, 2013

I know to get the spacial filter on an xref to get the clip verticies, but not how to tell if its an invert xclip.

Even the arx guys seem to have difficulty with this. How to do it with lisp, com, or arx code?

[URL] ......

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Code To Convert All Lines

Sep 18, 2013

I need a lisp code to convert all Lines, Polylines, Arcs and Splines to Polylines with 0.4 width.

I prepare this:
(defun c:CH2pl ( / SS);changes all lines, plines, arcs and splines to POLYLINE with 0.4 width(if (setq SS (ssget "_X" '((0 . "LINE"))))(command "_.pedit" "m" SS "" "Y" "w" 0.4 ""))(if (setq SS (ssget "_X" '((0 . "*POLYLINE"))))(command "_.pedit" "m" SS "" "w" 0.4 ""))(if (setq SS (ssget "_X" '((0 . "ARC"))))(command "_.pedit" "m" SS "" "Y" "w" 0.4 ""))(if (setq SS (ssget "_X" '((0 . "SPLINE"))))(command "_.pedit" "m" SS "" "Y" 10 "w" 0.4 "")))

 But I want pure lisp code in a professional way!

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Renaming Xref Using Code

Jun 18, 2013

This lsp was passed on to me from a colleague but he doesn't know where he got it. It does a useful procedure of placing each xref, residing in the drawing, to a unique layer. The layer name is derived from the xref name. I would like to edit this to take only part of the xref name. This system I work with requires all files to have the job number as a prefix eg LE1399901_Contours.dwg, so the xref name would be LE1299901_Contours by default. I want to remove the first 10 characters to be left with "X_Xref-Contours" layer name using this code.

(defun dxf (i a) (cdr (assoc i a)))
(defun c:lxr ( / ss cnt xrs en ed bn xp xbn )
(setq ss (ssget "x" '((0 . "INSERT"))))
(setq cnt 0)
[code]........   

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Code To Link To SCR File

Feb 19, 2012

LISP code to link to a scr.file.I would like to run ACADDOC.lsp with abobe code everytime I open a drawing.But I want to link the KISP file to script file of mine like C:

View 3 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 :: 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 :: Find DXFIN Command Code?

Sep 22, 2011

Where I can find the DXFIN command code? I want to examine it to see how it does what it does.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Code To Draw Grid Lines

Jan 1, 2014

I have this code to draw grid lines within a rectangle:
 
;Variable settings(defun var_set () (setq *var_lst* '("cmdecho" "osmode" "expert" "plinewid" "dynmode") *var_usr* (mapcar 'getvar *var_lst*)) (mapcar 'setvar *var_lst* '(0 0 2 0 0)) (vl-load-com))(defun var_reset ()(mapcar 'setvar *var_lst* *var_usr*)) (defun *error* (msg) (if (not (member msg '("console break" "Function cancelled" "quit / exit abort" "" nil)) ) (princ (strcat "
Error: " msg)) ) (and ;(vl-bt) (var_reset) ) (princ) ) (defun string-list (data) ;by lee-mac @theswamp (if (vl-string-search "@" [code].........

The above gets me the grid lines; but I have a block inserted at both ends of the grid line; how do I get the selection of those entities (selection set "frame") after each array?

or I would need to map a point list and draw each grid individually how do I go about that?

Attached is the sample of the output I'd like to achieve using LISP.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Code Removes Prefixes Bind

Dec 4, 2012

The code removes prefixes bind ($ 0 $), renaming layers, blocks, dimension styles, but some objects do not change the name as linetypes, text styles and duplicate names.If I have an existing name, I want to change the name with a (2) at the end.Example.

Layer: FloorLevel$0$Door90
If the layer "Door90" is existing, is renamed to "Door90 (2)"
(defun c:delprefixe(/ ActDoc Name NewName)(vl-load-com)(defun RemoveBindPrefix (String / Pos LastPos)(if (setq Pos (vl-string-search "$" String))(progn(setq LastPos Pos)(while (setq Pos (vl-string-search "$" String (1+ Pos)))(setq LastPos Pos))(substr String (+ 2 LastPos)))String));
[code]....

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

AutoCAD Visual LISP / AutoLISP :: Turnoff ModelLayout Tabs In 2014 From Code?

May 20, 2013

hiding the modellayout from code.My code is updating the registery properly.but it is not reflecting/hiding the model/layout tabs in application. hide/trunoff from code.Model/layout is not required for my application.Is there any command to  hide model/layout tab.

void CMyApp::TurnoffModelViewLayoutTAB()
{
//TurnOff Model View Tab   

[Code]....

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Edit Code To Import Setup Of Choice

May 16, 2012

I have the following code in a toolbar button that when I click on a setup within this tool it imports that setup into my current dwg. How to edit this code so that it will continue to import the setup of choice into the new drawing..but in addition....set the new one current & delete all previous setups that were in the drawing?

^C^Cfiledia;0;^Rpsetupin;"K:/_BARONE TEMPLATE FILE-2012/BARONE_PAGE_SETUPS.dwt";filedia;1

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Checking For Existence Of Drive Using Code Not Working?

May 2, 2013

I'm trying to check for the existence of a drive using lisp, then if not found perform a task (represented in my below example by the alert)

(if (vl-file-directory-p "C: en") T)(alert "exists"))

 I know it doesn't work because if I change the T to nil as demonstrated bellow I should invoke the opposite reaction from autocad but instead I get the exact same outcome which is an alert telling me the file exists?
 
(if (vl-file-directory-p "C: en") nil)(alert "exists"))

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Error / Bad Argument Type - Code Still Working

Jul 23, 2013

My code returns the error, but it still works.

    (vl-load-com)
    (setvar "cmdecho" 0)
    (vlax-for ucs (vla-get-UserCoordinateSystems (vla-get-Activedocument (vlax-get-acad-object)))
    (setq UCSList (cons (vla-get-Name ucs) UCSList)))
    (setq FileName (vl-Filename-Base (getvar "Dwgname")))
    (setq NewUCSList (vl-remove-if '(lambda (x) (vl-string-search FileName x)) UCSList))
    (setq Listlength (length NewUCSList))

[code]....

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Hatch Pattern Angles

Apr 11, 2012

Basically I have one hatch pattern that was used at different UCS values. The hatch patterns are correctly shown on the screen as shown in the attached image. But the puzzling thing is that they both have a pattern angle of 0.

I have been writing a program that globally changes hatch patterns, but the problem is that once I update the pattern, they all have the same angle. I need them to keep their current rotation when the patterns are updated. I cannot seem to find object access to what that actual angle is.

vla-get-patternangle does not seem to provide the data I am looking for.

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Create A Hatch Pattern

Jul 16, 2012

I'm trying to create a hatch pattern to match a floor tile. I want a 24" long x 6" wide plank tile.  The tiles should be offset from each other 8" (a 2/3 1/3 pattern lengthwise).  My problem is I only can get a 6" offset (3/4 1/4 pattern).Here's the code I've got:

0, 0,0, 0,6
90, 0,0, 6,6, 6,-18

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Convert Solid To Hatch?

Jan 6, 2005

is there a way to convert multiple 2d solids to hatches.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change All Hatch To Particular Layer

Nov 7, 2013

Lisp that can select all hatch in a drawing with a layer called AELE, even if it is embedded in a block and change it to layer AHAT with Green colour?

The layer AHAT may or may not already exist in the drawing.

We need to run the lisp on a lot of drawings (exported from Revit) so I need to use the script to run this lisp on multiple drawings.

View 3 Replies View Related







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