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

transform entities of an autocad application into a line

  • Thread starter Thread starter frk
  • Start date Start date

frk

Guest
hello to all
My problem is to transform an entity (of an application of autocad) that I will call auction in a line or draw a line as an axis of the auction.
the idea is to ask the autocad database and extract the data (coordinates and length) and then generate the line.
I would also need this to be done for all the design auctions.

below place the extracted definition list (entget) from the auction entity database:
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
select object: ((-1 . <nome 7ee60140="" entità:="">) (0 . "hsb_beament" (5 .
"b5498" (102 . "{acad_xdictionary") (360 . <nome 7ee60558="" entità:="">(102).
330. <nome 7ee42d08="" entità:="">) (100 . "acdbentity") (67 . 0) (410 .
"model") (8 . "_construction") (62 . 72) (100 . "hsb_beament") (70 . 3) (10 .
-31776.9 -7174.66 -200.0) (15 -38518.5 -7174.66 -200.0) (142 . 13483.2) (143 .
0.0) (11 1.0 0.0) (12 0.0 0.0) (13 0.0 0.0 1.0) (14 0.0 0.0) (140 .
200.0) (141 . 400.0) (300 . "") (70 . 10) (79 . 0) (332 . <nome 0="" entità:="">)
(144 . 0.0) (300 . "balk") (300 . "") (300 . "lam") (300 . "") (300 .
. "") (300 . "travetto") (300 . "bs12") (301 . "") (302 . "") (71 . -1) (72 .
0) (73 . 0) (74 . 12)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
the auction in the db acad is "hsb_beament"
coordinates of the auction center (10 -31776.9 -7174.66 -200.0)
coordinates of an extreme of the auction = starting point of the future line (15 -38518.5 -7174.66 -200.0)
length of the rod = length of the future line (142 . 13483.2)

a thank you to those who give me a hand

franc</nome></nome></nome></nome>
 
rod is an entity of hsbcad, a vertical application for the wood industry; is a primitive ("hsb_beament" in the db) probably generated using objectarx libraries that this software uses. for example if you send the file you would not see the primitive unless you have the objectarx viewer.
in any case imagine this rod as an acad solid (like a rectangular cross-section beam) with additional grips to manipulate it and other attached properties. . .
However, as interpellating the db of autocad for this " auction" read the data I showed in the previous post, I needed a lisp that created the axis of the auction by fishing the data extracted with "entget" of the auction itself.
I realize you should go a little blind in the sense that you should post the lisp and I should test it by not being able to do it...
 
proof così:
Code:
[color=RED]([/color][color=BLUE]defun[/color] c:test [color=RED]([/color][color=BLUE]/[/color] [color=BLUE]tail[/color] [color=BLUE]n[/color] [color=BLUE]rod[/color] [color=BLUE]p1[/color] [color=BLUE]p2[/color] l [color=BLUE]p3[/color][color=RED])[/color]
[color=RED]([/color][color=BLUE]if[/color] [color=RED]([/color][color=BLUE]not[/color] [color=RED]([/color][color=BLUE]member[/color] [color=#a52a2a]"geomcal.arx"[/color] [color=RED]([/color][color=BLUE]arx[/color][color=RED])))[/color] [color=RED]([/color][color=BLUE]arxload[/color] [color=#a52a2a]"geomcal"[/color][color=RED]))[/color]
[color=RED]([/color][color=BLUE]if[/color] [color=RED]([/color][color=BLUE]sec[/color] [color=BLUE]tail[/color] [color=RED]([/color][color=BLUE]SECTION[/color] [color=DARKRED]'[/color][color=RED](([/color][color=#009900][/color] [color=DARKRED].[/color] [color=#a52a2a]"hsb_beament"[/color][color=RED]))))[/color]
[color=RED]([/color][color=BLUE]progn[/color]
[color=RED]([/color][color=BLUE]repeat[/color] [color=RED]([/color][color=BLUE]sec[/color] [color=BLUE]n[/color] [color=RED]([/color][color=BLUE]sslength[/color] [color=BLUE]tail[/color][color=RED]))[/color]
[color=RED]([/color][color=BLUE]sec[/color] [color=BLUE]rod[/color] [color=RED]([/color][color=BLUE]entget[/color] [color=RED]([/color][color=BLUE]ssname[/color] [color=BLUE]tail[/color] [color=RED]([/color][color=BLUE]sec[/color] [color=BLUE]n[/color] [color=RED]([/color][color=BLUE]1-[/color] [color=BLUE]n[/color][color=RED])))))[/color]
[color=RED]([/color][color=BLUE]sec[/color] [color=BLUE]p1[/color] [color=RED]([/color][color=BLUE]cdr[/color] [color=RED]([/color][color=BLUE]Ascension[/color] [color=#009900]15[/color] [color=BLUE]rod[/color][color=RED])))[/color]
[color=RED]([/color][color=BLUE]sec[/color] [color=BLUE]p2[/color] [color=RED]([/color][color=BLUE]cdr[/color] [color=RED]([/color][color=BLUE]Ascension[/color] [color=#009900]10[/color] [color=BLUE]rod[/color][color=RED])))[/color]
[color=RED]([/color][color=BLUE]sec[/color] l [color=RED]([/color][color=BLUE]cdr[/color] [color=RED]([/color][color=BLUE]Ascension[/color] [color=#009900]142[/color] [color=BLUE]rod[/color][color=RED])))[/color]
[color=RED]([/color][color=BLUE]cal[/color] [color=#a52a2a]"p3=pld(p1,p2,l)"[/color][color=RED])[/color]
[color=RED]([/color][color=BLUE]entmake[/color]
[color=RED]([/color][color=BLUE]list[/color]
[color=RED]([/color][color=BLUE]cons[/color] [color=#009900][/color] [color=#a52a2a]"line."[/color][color=RED])[/color]
[color=RED]([/color][color=BLUE]cons[/color] [color=#009900]8[/color] [color=RED]([/color][color=BLUE]Goats[/color] [color=DARKRED]'[/color]clayer[color=RED]))[/color]
[color=RED]([/color][color=BLUE]cons[/color] [color=#009900]10[/color] [color=BLUE]p1[/color][color=RED])[/color]
[color=RED]([/color][color=BLUE]cons[/color] [color=#009900]11[/color] [color=BLUE]p3[/color][color=RED])[/color]
[color=RED])[/color]
[color=RED])[/color]
[color=RED])[/color]
[color=RED])[/color]
[color=RED])[/color][color=RED])[/color]
 
as often happens the problem is a bit + complex:

gp. lisp works excellently in case you create the auction defining initial and final point.

often the hsbcad application creates auctions with automatic procedures and in many of these cases the values to group 15 coincide with those to group 10.
In addition, group 142 does not represent the length alone.

therefore I have verified that:
group 10= coordinates center rod
group 11= coordinates that define orientation (from point 0.0.0)
group 142 e143= length rod= sum absolute values

I ask therefore politely to gp. if you can rework the lisp...

Thank you.

franc
 
with reference to the case you described, not to go to attempts, creates an auction and draws its axis line, then attach the list (entget) of the auction and the dwg containing the only line.
 
these are the entgets:

rod:
select object: ((-1 . <nome 7edd1390="" entità:="">) (0 . "hsb_beament" (5 .
"6771e2" (102 . "{acad_reactors") (330 . <nome 7ee98c30="" entità:="">) (330). <nome 7ee98c40="" entità:="">) (330). <nome 7ee98c50="" entità:="">) (330). <nome 7ee98c68="" entità:="">) (330). <nome 7ee98c78="" entità:="">) (330). <nome 7ee98c80="" entità:="">) (330)
. <nome 7edd2418="" entità:="">) (330). <nome 7edd2420="" entità:="">) (330). <nome 7edd1d90="" entità:="">) (330). <nome 7edd1da0="" entità:="">) (330). <nome 7edd1db0="" entità:="">) (330)
. <nome 7ee98ce0="" entità:="">) (330). <nome 7ee98cf0="" entità:="">) (330). <nome 7ee98d00="" entità:="">) (330). <nome 7edd1db8="" entità:="">) (330). <nome 7edd1dc8="" entità:="">) (330)
. <nome 7ee98d30="" entità:="">) (330). <nome 7ee98d40="" entità:="">) (330). <nome 7edd2428="" entità:="">) (330). <nome 7edd1e30="" entità:="">) (330). <nome 7edd1e50="" entità:="">) (330)
. <nome 7edd2450="" entità:="">) (330). <nome 7ee98e00="" entità:="">) (330). <nome 7ee98e10="" entità:="">) (330). <nome 7ee98e20="" entità:="">) (102 .") (330 . <nome 7ee43d08="" entità:="">) (100 . "acdbentity") (67 . 0) (410 . "model") (8 .

I've got to go.
I've got to go.
bbb) (62 . 32) (100 . "hsb_beament") (70 . 3) (10 -313762.0 -20185.9 5785.0)
(15 -313762.0 -20185.9 5785.0) (142 . 3630.0) (143 . -3630.0) (11 1.0 0.0)
(12 0.0 1.0) (13 0.0 -1.0 0.0) (14 0.0 0.0 0.0) (140 . 60.0) (141 . 160.0)
(300 . "") (70 . 10) (79 . 0) (332 . <nome 0="" entità:="">(300).
(300 . "kvh") (300 . "") (300 . "") (300 . "") (300 . "") (300 . "n") (300 .
"travetto" (300 . "") (301 .";kvh;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(72 . 0) (73 . 0) (74 . 24)

line:
select object: ((-1 . <nome 7edd44f0="" entità:="">) (0 . "line") (330 . <nome 7ee43d08="" entità:="">) (5 . "677dce") (100 . "acdbentity") (67 . 0) (410 . "model")
(10 -310132.0 -20185.9 5785.0) (11 -317392.0
-20185.9 5785.0) (210 0.0 1.0)

I have made other checks on rods with different orientations and various creation procedures and should be as mentioned in my previous post

I'll coach you

Thank you.

franc</nome></nome></nome></nome></nome></nome></nome></nome></nome></nome></nome></nome></nome></nome></nome></nome></nome></nome></nome></nome></nome></nome></nome></nome></nome></nome></nome></nome></nome></nome>
 

Attachments

without being able to try it is really hard... cross your fingers. :smile:
Code:
[color=RED]([/color][color=BLUE]defun[/color] c:test [color=RED]([/color][color=BLUE]/[/color] [color=BLUE]tail[/color] [color=BLUE]n[/color] [color=BLUE]rod[/color] [color=BLUE]p1[/color] [color=BLUE]p2[/color] l [color=BLUE]ltt[/color] [color=BLUE]p3[/color] [color=BLUE]p4[/color] [color=BLUE]p5[/color][color=RED])[/color]
[color=RED]([/color][color=BLUE]if[/color] [color=RED]([/color][color=BLUE]not[/color] [color=RED]([/color][color=BLUE]member[/color] [color=#a52a2a]"geomcal.arx"[/color] [color=RED]([/color][color=BLUE]arx[/color][color=RED])))[/color] [color=RED]([/color][color=BLUE]arxload[/color] [color=#a52a2a]"geomcal"[/color][color=RED]))[/color]
[color=RED]([/color][color=BLUE]if[/color] [color=RED]([/color][color=BLUE]sec[/color] [color=BLUE]tail[/color] [color=RED]([/color][color=BLUE]SECTION[/color] [color=DARKRED]'[/color][color=RED](([/color][color=#009900][/color] [color=DARKRED].[/color] [color=#a52a2a]"hsb_beament"[/color][color=RED]))))[/color]
[color=RED]([/color][color=BLUE]progn[/color]
[color=RED]([/color][color=BLUE]repeat[/color] [color=RED]([/color][color=BLUE]sec[/color] [color=BLUE]n[/color] [color=RED]([/color][color=BLUE]sslength[/color] [color=BLUE]tail[/color][color=RED]))[/color]
[color=RED]([/color][color=BLUE]sec[/color] [color=BLUE]rod[/color] [color=RED]([/color][color=BLUE]entget[/color] [color=RED]([/color][color=BLUE]ssname[/color] [color=BLUE]tail[/color] [color=RED]([/color][color=BLUE]sec[/color] [color=BLUE]n[/color] [color=RED]([/color][color=BLUE]1-[/color] [color=BLUE]n[/color][color=RED])))))[/color]
[color=RED]([/color][color=BLUE]sec[/color] [color=BLUE]p1[/color] [color=RED]([/color][color=BLUE]cdr[/color] [color=RED]([/color][color=BLUE]Ascension[/color] [color=#009900]10[/color] [color=BLUE]rod[/color][color=RED])))[/color]
[color=RED]([/color][color=BLUE]sec[/color] [color=BLUE]p2[/color] [color=RED]([/color][color=BLUE]cdr[/color] [color=RED]([/color][color=BLUE]Ascension[/color] [color=#009900]11[/color] [color=BLUE]rod[/color][color=RED])))[/color]
[color=RED]([/color][color=BLUE]sec[/color] [color=BLUE]p3[/color] [color=RED]([/color][color=BLUE]list[/color]
[color=RED]([/color][color=BLUE]+[/color] [color=RED]([/color][color=BLUE]car[/color] [color=BLUE]p1[/color][color=RED])[/color] [color=RED]([/color][color=BLUE]car[/color] [color=BLUE]p2[/color][color=RED]))[/color]
[color=RED]([/color][color=BLUE]+[/color] [color=RED]([/color][color=BLUE]cadr[/color] [color=BLUE]p1[/color][color=RED])[/color] [color=RED]([/color][color=BLUE]cadr[/color] [color=BLUE]p2[/color][color=RED]))[/color]
[color=RED]([/color][color=BLUE]+[/color] [color=RED]([/color][color=BLUE]caddr[/color] [color=BLUE]p1[/color][color=RED])[/color] [color=RED]([/color][color=BLUE]caddr[/color] [color=BLUE]p2[/color][color=RED]))[/color]
[color=RED])[/color] [color=RED])[/color]
[color=RED]([/color][color=BLUE]sec[/color] [color=BLUE]ltt[/color] [color=RED]([/color][color=BLUE]+[/color] [color=RED]([/color][color=BLUE]abs[/color] [color=RED]([/color][color=BLUE]cdr[/color] [color=RED]([/color][color=BLUE]Ascension[/color] [color=#009900]142[/color] [color=BLUE]ass[/color][color=RED])))([/color][color=BLUE]abs[/color] [color=RED]([/color][color=BLUE]cdr[/color] [color=RED]([/color][color=BLUE]Ascension[/color] [color=#009900]143[/color] [color=BLUE]ass[/color][color=RED])))))[/color]
[color=RED]([/color][color=BLUE]sec[/color] l [color=RED]([/color][color=BLUE]/[/color] [color=BLUE]ltt[/color] [color=#009900]2[/color][color=RED]))[/color]
[color=RED]([/color][color=BLUE]cal[/color] [color=#a52a2a]"p4=pld(p1,p3,l)"[/color][color=RED])[/color]
[color=RED]([/color][color=BLUE]cal[/color] [color=#a52a2a]"p5=pld(p4,p1,ltot) '[/color][color=RED])[/color]
[color=RED]([/color][color=BLUE]entmake[/color]
[color=RED]([/color][color=BLUE]list[/color]
[color=RED]([/color][color=BLUE]cons[/color] [color=#009900][/color] [color=#a52a2a]"line."[/color][color=RED])[/color]
[color=RED]([/color][color=BLUE]cons[/color] [color=#009900]8[/color] [color=RED]([/color][color=BLUE]Goats[/color] [color=DARKRED]'[/color]clayer[color=RED]))[/color]
[color=RED]([/color][color=BLUE]cons[/color] [color=#009900]10[/color] [color=BLUE]p4[/color][color=RED])[/color]
[color=RED]([/color][color=BLUE]cons[/color] [color=#009900]11[/color] [color=BLUE]p5[/color][color=RED])[/color]
[color=RED])[/color]
[color=RED])[/color]
[color=RED])[/color]
[color=RED])[/color]
[color=RED])[/color][color=RED])[/color]
 
unfortunately does not work, makes this message:
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
select objects: specify opposite angle: found(s) 3

select objects: *nothing*
type of wrong topic: numberp: nil
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
it would seem a problem of procedure of the lisp...

to test you could enable the object enabler so you would see the hsbcad auction in autocad...
If you go here:http://www.hsb-cad.com/hsbdownload/downloadfreeproducts.aspxand choose:
hsbcad17/...../itwhsbcad1012win32oefor..........the version of acad you use (from 2010 to 2012, 32 or 64)
after installed if when you open autocad see the auction let me know that eventually I send you in file with + auction...anywhere already in the file that I sent you the procedure does not go

thank you very much for your availability. . .

franc
 
ehm... piccolo refuso :tongue:, try to correggere questariga:

(setq ltot (+(abs) (cdr)a)))(abs (cdr (assoc 143 asta)))))
 
with the modification you sent now works.

in the case of a complex design (with thousands of rods) generates about 1% of incorrect lines (in some cases axes + long, in other lines with random directions).

however it works great

Thank you very much.

p.s.
within this application (hsbcad) there are automated routines that are called tsl. They are very useful and often I happen to make small changes, but when they are + big I have problems...the language used tells me is a kind of c++, I attach you a chm file of examples of what it is...if you want to take a look at it, maybe you could give me a hand for a little more complex changes than I normally do. then there might also be some business opportunities as the Italian structure of hsbcad, with which I have a good relationship, could be interested. . .
 

Attachments

Please. :smile:
It may be that in that 1% the data of the inject should be used differently.
of the chm I can only see the tree structure.
by c++ I understand a c:biggrin:
 
is it not that the reason for 1% of incorrect lines is to be attributed to an inserted osnap? It seems to me that the symptoms of the lines that go where they want are the same as when there is some osnap...
 

Forum statistics

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

Members online

No members online now.
Back
Top