• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

close with a line all the open points of a figure and generate a polylinea

  • Thread starter Thread starter blubossa
  • Start date Start date

blubossa

Guest
Bye to all,

I am trying to make a routine that after selecting ima figure, closes me, with a line, all the points open and generates a polyline.

thanks to you I have taken a few steps forward, but I need some other ideas.

In practice I am faced with always different forms, formed by lines, polylines, arches, which very often do not close the figure.. .

I thought I could store and order all the starting and ending points of an object to be able to compare later points and draw a line if it were different.

This is an idea, I think quite laborious but I don't think of any other solution.

I attach an example file.

Thank you.
bb
 

Attachments

If the figures are like the one you posted you can use this procedure:


command: editselect polylinea or [Polilinee]: pselect objects: select + sendconvert lines, arches and splines into polylinees [Sì/No]? <s> </s>stype an option [CHiudi/Apri/Unisci/Larghezza/ADatta/Spline/Rettifica/Tipolinea
gen./Inverti/ANnulla]: utype union = both (extend or add)
type approximate distance or [Tipo unione] <0.0000>: tspecify union type [Estendi/Aggiungi/ENtrambi] <estendi>: </estendi>entype union = both (extend or add)
type approximate distance or [Tipo unione] <0.0000>: 20
16 segments added to polylineatype an option [CHiudi/Apri/Unisci/Larghezza/ADatta/Spline/Rettifica/Tipolinea
gen./Inverti/ANnulla]:indigodo tests and check the differences between the types of union (extend or add).
 
If the figures are like the one you posted you can use this procedure:


command: editselect polylinea or [Polilinee]: pselect objects: select + sendconvert lines, arches and splines into polylinees [Sì/No]? <s> </s>stype an option [CHiudi/Apri/Unisci/Larghezza/ADatta/Spline/Rettifica/Tipolinea
gen./Inverti/ANnulla]: utype union = both (extend or add)
type approximate distance or [Tipo unione] <0.0000>: tspecify union type [Estendi/Aggiungi/ENtrambi] <estendi>: </estendi>entype union = both (extend or add)
type approximate distance or [Tipo unione] <0.0000>: 20
16 segments added to polylineatype an option [CHiudi/Apri/Unisci/Larghezza/ADatta/Spline/Rettifica/Tipolinea
gen./Inverti/ANnulla]:indigodo tests and check the differences between the types of union (extend or add).
Hi.
I had practically forgotten these editpl options, it works! !

Now I make a lisp and we simplify everything.

Thanks again.
bb
 
If the figures are like the one you posted you can use this procedure:


command: editselect polylinea or [Polilinee]: pselect objects: select + sendconvert lines, arches and splines into polylinees [Sì/No]? <s> </s>stype an option [CHiudi/Apri/Unisci/Larghezza/ADatta/Spline/Rettifica/Tipolinea
gen./Inverti/ANnulla]: utype union = both (extend or add)
type approximate distance or [Tipo unione] <0.0000>: tspecify union type [Estendi/Aggiungi/ENtrambi] <estendi>: </estendi>entype union = both (extend or add)
type approximate distance or [Tipo unione] <0.0000>: 20
16 segments added to polylineatype an option [CHiudi/Apri/Unisci/Larghezza/ADatta/Spline/Rettifica/Tipolinea
gen./Inverti/ANnulla]:indigodo tests and check the differences between the types of union (extend or add).
Hi.

do you have the English version options? I need it for the lisp.

Thank you.
bb
 
I wrote this lisp for the closure of the beads:

(setq a1 (getpoint))
(setq a2 (getcorner a1 "\n second point." )
(command "_pedit" "_p" a1 a2 "_j" "_t" "_b" 10 "" "")

I'm wrong with the command, where am I wrong?

I also tried this option:
(setq a1 (getpoint))
(setq a2 (getcorner a1 "\n second point." )).
(setq a3 (ssget "_w" a1 a2 (list '(8 . "l01")))))
(command "_pedit" a3 a1 a2 "_j" "_t" "_b" "" 10 """)

but also this goes wrong.... .

Thank you.

bb
 
I wrote this lisp for the closure of the beads:

(setq a1 (getpoint))
(setq a2 (getcorner a1 "\n second point." )
(command "_pedit" "_p" a1 a2 "_j" "_t" "_b" 10 "" "")

I'm wrong with the command, where am I wrong?

I also tried this option:
(setq a1 (getpoint))
(setq a2 (getcorner a1 "\n second point." )).
(setq a3 (ssget "_w" a1 a2 (list '(8 . "l01")))))
(command "_pedit" a3 a1 a2 "_j" "_t" "_b" "" 10 """)

but also this goes wrong.... .

Thank you.

bb
I also tried this string:

(command "_pedit" "_m"" (setq a1 (getpoint)) (setq a2 (getcorner a1) "" "_j" "_j" "_b" "")

but continues to give me the following error:
invalid selection
requires a point or window/last/frame....etc etc

Who helps me kindly?

Thank you.
bb
 
It's better to catch with ssget and pass the relative variable to the command, if you catch with window you have to tell him, before the two points enter "_w".

However the problem is that, depending on the selected objects, the command requests can be different and the lisp cracks.

You should create conditions (cond, if) to assign a command with specific syntax.

But why don't you use _pedit?? ?
 
It's better to catch with ssget and pass the relative variable to the command, if you catch with window you have to tell him, before the two points enter "_w".

However the problem is that, depending on the selected objects, the command requests can be different and the lisp cracks.

You should create conditions (cond, if) to assign a command with specific syntax.

But why don't you use _pedit?? ?
If you take a look above I used ssget..., but nothing:confused:

are many forms to treat therefore a lisp helped a lot! !

If I can handle something, I'll tell you.

Hello and thank you
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top