Hi there!
At our work we prefabricate water pipes, for this we need to manually write down the dimension and lenght off the pipe (displayed trough the properties of the polyline).
Is there any way to automate this?
For example get the diameter value from global width, and the length value from the polyline length?
The text needs to stay editable because some segments (all ending segments) need to be +500
It would save me LOADS of time
Bonjour @9009676
Here in a very simple solution, if it suits you as a principle we will look at how to improve it.
Amicalement from France
Didier Aveline
Hi,
i think this is about what im looking for, but it doesnt work.
when it always says "100.0" and gives this error:
wich is the correct diameter and lenght of the pline i selected.
1 more qeustion, is is possible to round the numbers off without a decimal?
That error looks like what could happen if the current Text Style is defined for a fixed height but the code assumes it's not [but I haven't examinned the code, and without a drawing file...].
EDIT: Having examined the code, that seems to be the issue. But I don't understand the intent:
(command "_text" "mc" pins "0.5" "100.0" {... the text content ....} )
With a fixed-height Text Style, the height is not requested, the rotation prompt is what gets answered with "0.5", the content is "100.0", and the intended content is treated as an attempted command. That's what you're seeing.
But with a non-fixed-height Style, the 0.5 is the height, the rotation is 100, and the content is as intended. So @-didier- , how are you getting zero-rotation Text out of it?
Hi @9009676
On my screen, the result is :
Please try to type an _ (underscore) before the letters mp in my LSP.
For the decimals, what do you need ? Zero decimals ? How should the value be rounded ?
12.49 will be 13 or 12 ?
Amicalement
Didier Aveline
Hi @Kent1Cooper
Thank You.
I did not think to this parameter, I always give a zero value in my style for the height.
We have to think at ALL possibilities of AutoCAD and the different habit of different people.
how are you getting zero-rotation Text out of it?
Because my parameters are gradians for angles, 100 is the value (gradians) of x axis.
Then for @9009676
If your text style has a height in its definition, the line must be :
(command "_text" "_mc" pins "0.0" (strcat "%%C"(rtos ep 2 2) " - " (rtos lon 2 2)))
Amicalement
Didier Aveline
I recommend you try Lee Mac's Quick Field program.
Try the "TEST2" example in the file, you can alter the field values, formatting and prefix to suit your needs. Then you have a field that will up date if the Polyline has been changed.
Hi @9009676
Memorizing a list is possible, of course, but for which goal ?
If the length of the polyline is not included in the list, what should be written ?
The nearest value?
And in this case : Do I have to change the length of the polyline to be in accordance with what is written?
And from where do I cut or extend the polyline, from the beginning ? From the end ?
Maybe I misunderstood the case
Give examples in a DWG please.
Amicalement
Didier Aveline
This on screen is exactly what i need. i fixed my text height settingd and it works now! there should be 0 decimals! so, 16mm radius 1215mm lenght is displayed as Ø16 - 1215
Bonjour @9009676
OK, then I wrote a new version, with some controls.
I hope that these modifications will be useful for your use.
At your disposal if you wish to improve this code.
Amicalement
Didier Aveline
Can't find what you're looking for? Ask the community or share your knowledge.