AutoCAD Visual LISP / AutoLISP :: Accessing Hatch Area From ActiveX
Mar 30, 2007
Hatch 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?
On a Chinese computer with Windows XP, the layout name via ActiveX is displayed correctly "A3 -布局-02" on the variable laynam.
But under Windows 7 64 Bit I get this "A3 -??-02". So all ActiveX objects with AutoLisp commands do not transfer the Chinese Unicode characters, also on a system in china.
But the pure lisp command (layoutlist) for example returns always the correct characters ("A3 -布局-02")
Do I need any Chinese dll’s for ActiveX dependent language? On my test PC I installed the file autocad_2013_traditional_chinese_language_pack_win_64bit in the hope I get shared files for ActiveX but this did not bring success.
What about creating an AutoLisp selection set from .NET - is it possible, if so I would prefer to do that instead?
The goal is to create some objects in .NET (using activeX or managed code) and then have some way to access these objects via the command line I'm assuming they only way is using an AutoLISP selection set.
How to access the information stored with an AcDbScale object using Visual Lisp. I can convert the vla-object to an ename and then use association codes to extract the data, but surely there's an easier, more direct alternative.
I have a small app to create, related to point clouds.
I know VisualLISP pretty well, definitely well enough to accomplish the task.but...I can't figure out how to retrieve information on the point cloud's clipbox using lisp.
I know a little VB.NET; I took a one-semester class at the JC, two years ago. It's going to take time for me to get ramped up enough with VB to do this job, so I don't really want you to tell me the only way to get to the clipbox is through vb.
way to retrieve and modify a point cloud's clipbox with VisualLISP?
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.
I have a new project coming up where I need to write some simple programs to access the dynamic action parameters in some existing dynamic blocks.I have viewed what I could find on AU, but I still ave not found anything relating in-depth to dynamic blocks.
Any good Tutorials, Articles, or White Papers, on working with dynamic blocks with autolisp/ vlisp? The main function is to access a parameter and change it by entering a numeric value, updating the block. say from a linear/polar stretch, or a linear/ polar move.
I'm writing some code to create various structural members, but I also need to add the texture map. Since it is doing the creation via VL, I need a way to add a material without that darn dialog box. Can material be add to a member programaticlly?
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:
I'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).
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.
i'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
I would like to be able to draw squares by the area they should have. So that if I need a square of 50m2 autocad automatically draws a square of sqrt(50) x sqrt(50)
Because right now I have to draw 200 squares with 100 different areas and I have to calculate and manually draw each one of them.
I have a closed polyline that i can add the area to via a field in mtext using the options under area. I would like the area to always be rounded down to the nearest square meter. Is the a way to do this via the acfields.fdc file?
I 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 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!
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.
I'm wondering if there is a lisp possible to measure area's by pick point (as in bpoly). This little feature exists in Microstation so i was looking for something similar.
Is it also possible if this lisp can measure areas from an external reference (dwg, dxf, dgn, shp etc..)? I'm kind of new to AutoCAD in that sence.
I have many floorplans and each room has a polyline around it.
What I'd like to do, is be able to select multiple (or single) polylines and have a dynamic field with the area attached to each polyline placed in the middle (or on a consistent edge, say top left). Preferably with custom units as we use mm for the drawings, but would want the area in m2. Also custom text heights.
I can find a lot of 'put the area in the middle' scripts, but they're either not dynamic or they require a click to place each one - and with over 700 floorplans and over a hundred or more rooms on some, it's not really possible to do each one individually!
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'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.