anouar Posted Monday at 02:50 PM Posted Monday at 02:50 PM (edited) Hello my friends please help me to find a lisp calculate both area perimeter and weight you find example attached. essai.dwg Edited Monday at 02:51 PM by anouar perimeter Quote
didier-acadlabs Posted Monday at 04:36 PM Posted Monday at 04:36 PM (edited) Bonjour @anouar The example of drawing you give us is complicated to do what you ask. Indeed, a circle in another is not a trivial example to calculate the perimeter. You still work with this shape? For area: no worries. For weight: no worries. For the perimeter: almost impossible. Amicalement Edited Monday at 04:37 PM by didier-acadlabs Quote
BIGAL Posted Monday at 09:40 PM Posted Monday at 09:40 PM (edited) Looks like a pdf import, the "Circle/pline" are not correct size. The values displayed do not match the 2 circles etc ?? Please show the area as say a hatch and point to perimeter. Welcome aboard. Edited Monday at 09:41 PM by BIGAL Quote
anouar Posted Tuesday at 08:16 AM Author Posted Tuesday at 08:16 AM 15 hours ago, didier-acadlabs said: Bonjour@anouar L'exemple de dessin que vous nous donnez est compliqué à faire ce que vous demandez. En effet, un cercle dans un autre n'est pas un exemple trivial pour calculer le périmètre. Vous travaillez toujours avec cette forme ? Pour l'aire : pas de soucis. Pour le poids : pas de soucis. Pour le périmètre : quasi impossible. Amicalement hello no I work on aluminum profiles of different shapes each time I have to calculate the surface and the perimeter and the weight of an object after subtraction attached another form please help me I have a lisp which is good but does not calculate the weight by the formula (surface * 2.7) / 1000 also is not applicable on the object that is to say after subtract essai 2.dwg Polylin Area & Length FA.LSP Quote
didier-acadlabs Posted Tuesday at 02:30 PM Posted Tuesday at 02:30 PM Bonjour @anouar Here is what I propose Amicalement Anouar-CadTutor.lsp 1 Quote
GLAVCVS Posted Tuesday at 06:00 PM Posted Tuesday at 06:00 PM Let's see. I don't quite understand what you need. Let me see if I get it right: do you need a few more lines of text where "Weight = [result of: (area * 2.7) / 1000]" appears? 1 Quote
didier-acadlabs Posted Wednesday at 10:16 AM Posted Wednesday at 10:16 AM Bonjour @anouar I don't know if you are interested in my proposition, but it is certain I made a mistake in. I forgot to divide by 1000 for the calculation of the weight. Are you able to fix the problem ? Or do you need help ? Amicalement 1 Quote
GLAVCVS Posted Wednesday at 10:22 AM Posted Wednesday at 10:22 AM @didier-acadlabs I think there is a small problem with that: the result of the operation should be displayed highlighted as the area and perimeter Quote
didier-acadlabs Posted Wednesday at 10:34 AM Posted Wednesday at 10:34 AM Bonjour @GLAVCVS I don't understand your message. Where is the "small" problem ? Have you read my solution? If this is the case, you understand that this line I correct is part of a general (setq) Amicalement 1 Quote
GLAVCVS Posted Wednesday at 11:07 AM Posted Wednesday at 11:07 AM (edited) In Anouar's code, numerical calculations are shown in highlighting. If this is important, you may need to change something in your code. 4 minutes ago, GLAVCVS said: @ didier-acadlabs Edited Wednesday at 11:09 AM by GLAVCVS 1 Quote
didier-acadlabs Posted Wednesday at 11:15 AM Posted Wednesday at 11:15 AM Bonjour @GLAVCVS Yes, it is the case, but the fields are only interesting when it is possible to modify the entity and therefore change the value of the field. With the calculation of weight, it becomes more complicated. So I made the choice to work with text and not with fields. Because regions are not entities that can be easily modified. I am waiting for the answer of @anouar He will say whether it is correct or not. Amicalement 1 Quote
BIGAL Posted Wednesday at 11:11 PM Posted Wednesday at 11:11 PM "With the calculation of weight, it becomes more complicated." Fields can have formulas so you can get area and * weight. 1 Quote
anouar Posted 2 hours ago Author Posted 2 hours ago On 18/02/2025 at 15:30, didier-acadlabs said: Bonjour@anouar Voici ce que je propose Amicalement Anouar-CadTutor.lsp 996 B · 4 téléchargements Hello thank you very much yes that's it but there is a problem during the application see attached document. Quote
anouar Posted 2 hours ago Author Posted 2 hours ago On 19/02/2025 at 12:04, GLAVCVS said: @ didier-acadlabs Hello yes it is my request area perimeter and weight but I want a lip already prepared and applicable Quote
anouar Posted 2 hours ago Author Posted 2 hours ago On 19/02/2025 at 12:15, didier-acadlabs said: Bonjour@GLAVCVS Oui, c'est le cas, mais les champs ne sont intéressants que lorsqu'il est possible de modifier l'entité et donc de changer la valeur du champ. Avec le calcul du poids, cela devient plus compliqué. J'ai donc fait le choix de travailler avec du texte et non avec des champs. Car les régions ne sont pas des entités facilement modifiables. J'attends la réponse de@anouar Il dira si c'est correct ou non. Amicalement Hello yes it's ok thank you Quote
didier-acadlabs Posted 2 hours ago Posted 2 hours ago Bonjour @anouar I understand that it is ok for you ? No need for working again on the question Amicalement 1 Quote
anouar Posted 2 hours ago Author Posted 2 hours ago On 2/19/2025 at 11:16 AM, didier-acadlabs said: Bonjour @anouar I don't know if you are interested in my proposition, but it is certain I made a mistake in. I forgot to divide by 1000 for the calculation of the weight. Are you able to fix the problem ? Or do you need help ? Amicalement hello yes that's it but I'm looking for lisp prepared for direct use Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.