AutoCAD Visual LISP / AutoLISP :: Convert Solid To Hatch?
Jan 6, 2005is there a way to convert multiple 2d solids to hatches.
View 9 Repliesis there a way to convert multiple 2d solids to hatches.
View 9 RepliesI 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 RelatedI'm looking for a lisp routine which will 'convert' number of 2dsolid into hatch. Drawing contains dozens of 2dsolids (solids are on one layer, there are also other entities on this layer) which have different colors, have common verticies and edges. i.e. I want to kind of 'join' solids of the same color and convert them into one hatch colored as original solids and placed on existing layer (let it be layer '0' zero for now). Same color solids can exist in few locations - there is a case to make few separate hatches of the same color (all joined solids should be represented as 1 hatch, should not separate after separate hatch command). There is max of 20 different colors (all of them from ACI index). Solids are not crossing themself or other solids (just joining with 1 or 2 verticies).
There are also 2dsolids with 'zero-area' - represented as a line - those should be erased at the beginning (not to have a line-like hatch).
Example drawing attached.
I need a function that allows to convert the polylines selected with a width globalize defined in a double closed line (spaced by the same width of the polyline), with a hatch inserted automatically defined.
Brilliant idea to draw raceways quickly: instead of making handmade double lines, connect, enter the hatches all by hand, you could quickly draw the polyline with width identical to the size of the duct, and then the lisp transform it into a duct more aesthetically pleasing if compared to the full polyline!
Looking for a lisp to convert a poly face mesh to a solid.
View 1 Replies View RelatedI 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?
We have this need to have all of the solids in a drawing to be placed in the "solid" layer.
Sometimes folks are drafting lines to develop these solids, and keeping the lines on the "solid" layer, rather than moving them to another layer, or deleting them altogether.
I could get folks to run this command before leaving the drawing.
I'm thinking something along the lines of:
Select all entities that are on the solids layer that are not solids.
If nil, great, do nothing.
If entities are selected, let me do something with them.
I'm hoping the following can be modified ever so slightly.
(setq non_solid (ssget "X" (list (cons 0 "3DSOLID")(cons 8 "solid"))))
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.
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
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.
I have the following code to delete all hatch in a drawing. At the end of the command there is a notice that all hatch have been eliminated.
However, the last message displayed is: "Hatch boundary associativity removed".
(defun c:deletehatch ( / d l )(vl-load-com) (setq d (vla-get-activedocument (vlax-get-acad-object))) (vlax-for a (vla-get-layers d)(if (eq :vlax-true (vla-get-lock a))(progn(vla-put-lock a :vlax-false)(setq l (cons a l)) ) ) ) (vlax-for b (vla-get-blocks d)(if (eq :vlax-false (vla-get-isxref b)) (vlax-for o b (if (wcmatch (vla-get-objectname o) "AcDbHatch")(vla-delete o)) ) ) ) (foreach a l (vla-put-lock a :vlax-true)) (vla-regen d acallviewports) (princ (strcat "All HATCH have been removed")) (princ))
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 Relatedi'm newbie in customizing tools in autocad especially in creating hatch pattern. i understand that to create new hatch pattern is by adding a new hatch pattern in acad.pat file with specific angle.
my question is is it posibble to create a hatch pattern that can use specific angle follows the object shape?
This is what autocad can do by default this is what i'm trying to create
when I use the "_list" or "_massprop" command in AutoCad I can see the information in the attachment. when I use "(entget (entlast))" I can't see the values for the frame (Begrenzungsrahmen)
How can I get these values for the frame (Begrenzungsrahmen) in LISP?
Routine that will draw a insulation hatch around a circle?
View 9 Replies View RelatedHatch objects: Note To access this property, use the IAcadHatch2 interface.How can I access the Object.Area of an AutoCAD hatch. AutoCAD 2006 has properties that can be assigned to Fields so why can't I find the object att- area in any lisp vars?
View 7 Replies View RelatedIs it possible to include a point entity (rather than a zero-length line as in the standard SQDOTS pattern) in a custom hatch pattern?
If so what's the exact format of the line in the .pat file that defines the point?
know if there is a way to subtract one solid from another "with clearance" i.e. with an additional evenly applied clearance? I have seen this function in other applications, wondering if it possible somehow in Autocad?
View 1 Replies View RelatedI don't give the right keywords with Google !?So from a classic selection (or ALL for ALL Blocks of the DWG) of entities,
we will keep ONLY blocks (Static or Dynamic)I am looking for a Lisp/VLisp routine to update all Color of Hatches inside Blocks when the Hatch Color is xxx If the color hatch is NOT XXX we don't update !
The problem : update all hatch from blocks where Color = 255 (or any other value)
---> other classic Color (1-256)
--> RGB Color 255,255,255 or any other
I don't know at all how to switch hatch entities from classic color to RGB color inside a Block..And dynamic block in Lisp/VLisp are far from my level 0.2 in Lisp ...
I am wanting to build an installer to deploy some custom hatch patterns. Getting the hatch patterns onto disk is easy; however, I need to add this location as a support path (presumably via a registry entry) but the number of potential registry entries is huge given the combination of AutoCAD releases and verticals. The other option I had was to deploy the hatches to the same location as ACAD.PAT and search for this location during installation.
FYI - I plan to use Inno Setup but am not opposed to another installer.
I have a bolt program that draws the thickness of a bolts in elevation as a polyline with a global width, what i need is a lisp to then change this lwpolyline to a hatch, ie if global width is 20 and the polyline is 30 long i need to change this to a 20x30 solid hatch, is it possible to get the the global width and length and convert this to a boundary hatch? I need the same thing done for bolts in plan too as the circle is a lwpolyline also.
View 9 Replies View RelatedI am trying to do some minor animation with a shaded solid model. I have tried mslide and a script... this make s very jerky, flashing animation.
I tried a lisp routine to move the object in small increments, again the motion is very flashy and slow, as it appears to struggle perhaps with the shading.
I noticed doing a move command, and moving the same object manually, dragging the object around the screen with a mouse makes for pretty smooth motion. Way better than what I was doing.... Is there a way to do this programatically?
Lisp to draw a line along the length of a 3d solid? I have some UB (I sections) columns and beams modeled and would like to select all solids and for it draw a centerline end to end
View 7 Replies View RelatedI need to convert a lot of different hatches to solid hatches.
I haven´t found a way to do it in Autocad 2012.
script that cycles to all selected hatches and change the properties to solid?
Any routine that would allow you to cut out an odd shape from a solid with the profile of a polyline?The goal would be to have all the pieces that are left, not subtract them out..
View 3 Replies View RelatedI am trying to write a lisp routine that will make a layer called hatch, set it as current and then run the hatch command.
BUT the hatch command is not bring up the hatch dialogue box, it just puts things on the command line.
The layer is being made & set current.
The lisp is as follows:
(defun c:hh (/ ec)
(setq ec (getvar "cmdecho"))
(setvar "cmdecho" 0)
(command "-layer" "m" "hatch" "c" "8" "" "l" "continuous" "" "s" "hatch" "")
(command "hatch")
(setvar "cmdecho" ec)
)
On another matter, I have just found the bevel lisp routine by Terry Miller which works great BUT only for imperial measurements. How to make Terry's metric, that will work for metric measurements.
I want to create a custom linetype that uses a solid rectangle 0.5wide and 1.0 long. Basically I want to create a shape file from an existing block I have so that I can insert it into the linetype definition. Is there an easy way to do this in ACAD 2009?
View 8 Replies View RelatedMy work needs to convert thousands of DGN files to DWG. We are using AutoCAD 2012. Is it possible to batch convert dgn files with a LISP and a mapping file?
View 9 Replies View RelatedI have a list that is "acl", I would like to convert it to a string "acl", everything that I have read uses alot of code. Does this really take that much code to do?
View 9 Replies View RelatedWhat is the Command that Converts a Field to Text so that I can stop a Field updating after the initial set-up? I need to apply this in lisp.
View 9 Replies View RelatedI 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!