Autocad Lisp for Draw Cross Section
This command allows you to find areas indicating an internal point between objects or by selecting closed contours, this command shows the area obtained or otherwise sets it in a selected text.
The Ax command has the following options:
Initial requests:
Specify an internal point of the area or [Select object / Options] :
Here you must indicate the internal points from which the area will be obtained, the other options are described below:
Select object: Instead of specifying internal points to find airs, you can select closed polygons to find your area.
Options: This option loads the Command Options dialog box, the dialog box is as follows:
Each option is described below:
Number of decimals: The number of decimal places the area will have (2 by default).
Height of text to insert: If you decide to insert a text with the area obtained, here is set the height that will have said text.
Conversions of areas: This option allows you to perform operations with the values of the areas found, each area is added, subtracted, multiplied or divided by a factor that must be specified in the lower part of this option.
The command shows if the conversion is active and which of the operations is carried out and with what value the conversion will be carried out.
This option allows you to customize the areas when the drawing is in different scales or in other drawing units.
Apply shading: This option allows each indicated area to be shaded to have a better view of the area that is being found, thus allowing to verify if it is correct (Enabled by default).
Name of the shading: Here you must indicate the name of the shading to be applied in the indicated areas (Solid default).
(Shading) Scale: Here the scale factor of the shading is indicated, this factor is variable according to the type of shading selected.
Color (shading): The color that the shading will have applied in the indicated areas.
Finishing the shading: The options below apply once the command application is terminated.
Hold contours: If enabled the generated contours are not deleted.
Hold shading: If enabled the generated shadings are not deleted.
Final Requests:
Specify an internal point of the area or [Select object / Insert area text / Options] :
Insert text area: This option allows you to insert a text with the obtained area instead of selecting one to replace it. The text with the area found has the default prefix: " Area =", this prefix can be modified in the program code.
Change text: This option is activated when the Enter key is pressed or the right mouse button is pressed, which will request a text to be selected, for example if there is a text with the following content: "AC=0.00m2" and through the command an area of 3.25 has been found, then the command will replace the text, updating it to "AC=3.25m2". As you can see, AX replaces only the numeric values of the text to be replaced, so you can have area texts with different prefixes, for example: "AR=0.00m2", "AM=0.00m2", "Cutting area =0.00m2", "My area=0.00m2", etc.
Valid and invalid outlines:
Valid outline
To use this routine you must do the following:
- Load the lisp file in AutoCAD.
- Enter the name of the command: AX
- Indicate an internal point in the area you want to find (you have to make sure that the area to be found must be completely closed, otherwise the command will display an error message).
- Indicate internal points as many times as you need, the command will rage, accumulating (summing) all the airs found.
- Press Enter or right-click to end the command and set the area in an existing text.
You can get the routine here!
This small routine performs the same as the previous one, the difference is that the name of the layer is not entered here to select the objects, but an entity is selected from which you want to obtain the name of the layer.
As in the previous routine, the selection of entities is not made visible, but it exists as a set of selected entities, so the selection mode must be indicated "Previous" to select the objects.
To use this routine you must do the following:
- Load the lisp file in AutoCAD.
- Enter the name of the command: ssl
- Select the object you want to get the layer name to select the other entities
- Make effective the selection of entities by means of the predictive mode
You can get the routine here!
Using this routine you can delete the objects that are in the inner or outer area of a selected polyline, if the option is indicated, the objects that are intersected by the polyline will be cut by the side indicated.
When it comes to removing objects outside the polyline, special care should be taken as This command deletes all objects outside the polyline.
The polyline to select Must be a closed polyline, otherwise the routine joins the last point of the segment with the first, Closing thus by means of an imaginary line the polyline and eliminating everything that is inside or outside that line.
The option cut as it is logical, only works with objects that can be cut manually, As for example, lines, circles, arcs, etc, blocks and other compound objects do not fit inside these objects that can be cut out.
With the lisp a sample file is attached So that the corresponding tests are done before using the command in final files.
To use the routine you must do the following:
- Load the lisp file in AutoCAD.
- Enter the name of the command: PolErase
- Select polyline Which will serve as an edge to delimit the objects to eliminate.
- Choose one delete objects option, you can choose the option: Window (it only deletes objects that are totally outside or inside that window), Capture (Removes objects that are even intersected by the edge of the polyline), delete and crop (As the name implies, it will erase objects that are inside or outside the polyline and trim objects that intersect the edge.
- Indicates a point on which side (internal / external) will erase or trim objects.
You can get the routine here!
It is a lisp routine that allows you to select all entities that are in the indicated layer, does not distinguish color or other property that may have the entity.
This routine is not case sensitive at the time of entering the name of the layer, so you can enter in any way, just that it is well written.
To use this routine you must do the following:
- Load the lisp file in AutoCAD.
- Enter the name of the command: sca
- Enter the layer name of the objects you want to select
- Effect the selection of entities by means of the mode Previuos
You can get the routine here!
It is a routine made with the autolisp programming language, it allows us to copy the content of a selected text, and set that value in a second text to be selected.
To use this routine, you must do the following:
- Load the lisp file in AutoCAD, using the comado Appload Or simply by copying the file and pasting it into AutoCAD.
- Enter the name of the command: RT
- Select the text, from which you want to get the value.
- Select the text, which you want to replace with the previously obtained value.
As you can see, the routine is simple, but it is very helpful when it comes to text editing.
It should be noted that the language used in this routine is clearly AutoLisp, in a new entry we will publish the same command but written in VisualLisp, in which we will observe that the size of the structure is further reduced.
You can get the routine here!
This lisp routine allows you to change the number of decimals of the selected texts without losing the original number of decimals, with that you can display a number for example with 2 decimals, but internally it will have a new property with its originally defined value.
This new property can only be accessed by this command, since it is not listed by the Properties dialog box.
The lisp allows you to change the number of decimals or obtain the original number of a text formatted earlier with this routine, So you know how many decimals you had originally If you want to reset the original values.
It is noteworthy that these original values remain Even though the file or AutoCAD has been closed, so you have the security that the original data of Your values will always be there, even in spite of restoring the original values to the texts.
This new command could be compared to the action of To change Excel decimals, But the only observation is that this property is internal and as we said earlier The Properties window is not ready to display extended date entities.
Particular consideration must be given to The selected texts are numerical texts, that is, they only contain numbers, since otherwise their value will be converted to "0.00".
To use the routine you must do the following:
- Load the lisp file in AutoCAD.
- Enter the name of the command: AREDE
- Choose one of the options you want to perform
- Select the (numeric) texts in which you want to perform the operation
You can get the routine here!
Routine developed with AutoLisp that allows us to align several texts based on the first one selected.
The program allows you to align the texts vertically (columns) or horizontally (rows), for this you only have to select the first, which will serve as a basis for aligning the other texts.
It should be noted that the point taken as the basis for aligning the texts is the insertion point, if all the texts have the "Left" justification as the insertion point, all of them will be aligned with respect to this point and it will be a uniform alignment. If the texts have different justification, they will all be aligned with respect to their insertion point, which will cause the alignment of the texts to be inconsistent.
To use this routine you must do the following:
- Load the lisp file in AutoCAD.
- Enter the name of the command: lit
- Select the base text from which the alignment axis will be obtained
- Select the texts to align
- Done, the texts were aligned based on the first selected
You can get the routine here!
Source: https://www.twingeo.com/44-routines-lisp/
0 Response to "Autocad Lisp for Draw Cross Section"
إرسال تعليق