HCBBS Forum (English)
Submit Chemical Projects / Find Solutions
Amplify Your Requirements on a Broader Chemical Platform *Engineering · Technology · Equipment · Solutions*
Submit Request

Examples of geometric calculator applications (continued)

2010-10-14View Original

Thread Content

Example of a geometric calculator application (continued). The geometric calculator is a very useful tool provided by AutoCAD. Like a regular calculator, a geometric calculator can perform operations such as +, -, *, and /, as well as trigonometric functions. This allows users to perform arithmetic calculations on their computer while using AutoCAD for drawing, without having to interrupt the commands; AutoCAD then uses the results of these calculations as parameters for the commands. But importantly, unlike ordinary calculators, the AutoCAD geometric calculator can perform geometric calculations. It can perform addition and subtraction operations between coordinate points; it allows the use of AutoCAD’s OSNAP mode to locate coordinate points on the screen for such calculations, and it can also automatically compute geometric coordinates. Such as calculating the intersection point of two intersecting lines, or finding the equal division points on a line. In addition, the AutoCAD geometry calculator also has the capability to calculate vectors and normals. Of course, the AutoCAD geometry calculator has other functions as well, which will not be listed here one by one. When using AutoCAD for drawing, it is often necessary to determine some points for which coordinates cannot be given directly. For example, the midpoint between any two points ; The center of a circle tangent to a straight line in any direction ; And any equal division points on the straight line, etc. This is what we usually refer to as the positioning issue in CAD drawing. In fact, in many computer graphics applications, the convenience and accuracy of positioning often directly affect the efficiency and speed of drawing. Therefore, the geometric calculation functions of the AutoCAD geometry calculator should be fully utilized to achieve rapid positioning in AutoCAD drawing. In the Command prompt, type CAL or use one of the submenu options to activate the drop-down menu; selecting the geometric calculation option will start the AutoCAD geometric calculator. The CAL command is also a transparent command that allows the geometric calculator to be activated at any time under other commands. Additionally, the CAL command can also be used in AutoLISP programs. Below are several examples of quick positioning tasks that are commonly encountered in AutoCAD drawing, implemented using the geometric calculation functions of the AutoCAD geometric calculator. 1. Determine the midpoint between two entities. There is no need to first draw a helper line between the two entities and then use OSNAP’s MID mode to find the midpoint. For example, to draw a line starting from the center between a circle’s center and an endpoint of a line. The procedure is as follows: Command: line. From point: cal (start the geometric calculator) >> Expression: (cen+end)/2 (enter the expression; here, the calculator uses the OSNAP cen and end modes as temporary storage for point coordinates). >> Select entity for CEN snap – use the cursor to locate the center of the circle. >> Select entity for END snap – use the cursor to locate the endpoint of the line. Topoint: Other target snapping modes such as int, ins, tan, etc., can also be used in geometric calculation expressions. If the expression (cur+cur)/2 is used in place of the expression (cen+end)/2, it is possible to set the OSNAP mode to capture the desired point when the computer requests input. 2. Determining any equal division points on a line and points that are at a fixed distance from the line’s endpoints can be done using the plt and pld functions provided by the geometric calculator. Suppose there is a line on the screen with endpoints A and B, and we want to find a point on this line such that the segment AB is divided in a 1:2 ratio. Still taking drawing a straight line as an example, the procedure is as follows: Command: line; Frompoint: cal >> Expression: plt(end,end,1/3) >> Select the entity for the END snap by using the cursor to locate endpoint A) >> Select the entity for the END snap by using the cursor to locate endpoint B, thereby obtaining the point that is 1/3 of the segment’s length away from point A). Tooint: If you want to get a point on the line that is 5 units away from endpoint A, use the function pld(end,end,5) in place of plt(end,end,1/3) in the previous steps. 3. Using relative coordinates to determine points: In drawing, it is often necessary to draw one line relative to another line. Here is the procedure: Command: line Frompoint: cal >> Expression: end+ (performs an addition operation between two points) >> Select entity for END – by selecting the endpoint of a reference line, the point at a relative distance of (2,3) from that endpoint can be obtained. Topoint: This function is similar to the From target snap mode available in AutoCAD R13. 4. Drawing circles tangent to a diagonal line and drawing tangents to a circle from a point on it: It is easy to draw circles tangent to vertical or horizontal lines using AutoCAD’s ortho mode. To draw a circle tangent to a slanted line, it is necessary to determine the center of the circle with precision. The procedure is as follows: Command: circle 3P/2P/TTR/:cal >> Expression: cur+3*nee (cur refers to selecting a point on the screen using the cursor; the nee function is used to calculate the normal vector of the vector between the two endpoints, and 3 represents the radius of the circle) >> Enter a point: nea (select a point on the line using the cursor as the tangent point between the circle and the line) to >> Select one endpoint for NEE (select one endpoint of the line using the cursor) >> Select another endpoint for NEE (select the other endpoint of the line using the cursor) Diameter/: 3 (once the radius of the circle is specified, the circle can be drawn). By changing the order in which the cursor selects the two endpoints of the line, it is possible to draw the circle on the other side of the line. The process of drawing a tangent to a circle passing through its intersection point with a line is as follows: Command: line; From point: int (capture the intersection point); Topoint: cal >> Expression: int + 3 * nor(cen, int) >> Select entity for INT snap (use the cursor to capture the intersection point); >> Select entity for CEN snap (use the cursor to capture the center of the circle); >> Select entity for INT snap again (use the cursor to capture the intersection point), thereby drawing a tangent to the given circle with a length of 3 starting from that intersection point
Reply #22010-10-19
Such a great thing yet no one supports it – could it be that nobody understands it?
Reply #32010-11-12
I don’t understand; my skills in this area aren’t professional. Generally, people who do drawing rarely use code and instead opt for straightforward, user-friendly drawing methods
Reply #42010-11-14
It’s rotated, but it’s still quite good
Reply #52010-11-18
Reply to 1# kis_ing: Thank you for sharing! !

Submit a Project

**Looking for Chemical Technology, Equipment & Solutions?** No Registration Required Broader Platform Exposure | Global Chemical Service Provider Connections

Submit Request — Free Consultation

Disclaimer

This is an automated machine translation of the original thread. Some technical terms may have inaccuracies; the original text shall prevail. Click "View Original" at the top right to access the source page, which supports IP-based automatic real-time language translation. Please watch out for contact details and sales inducements to prevent fraud. All content and translations are for reference only, representing solely the poster's personal views. For enquiries, email service@hcbbs.com.