Author Topic: If you are smart...  (Read 15124 times)

0 Members and 1 Guest are viewing this topic.

ribarm

  • Gator
  • Posts: 3255
  • Marko Ribar, architect
If you are smart...
« on: September 18, 2014, 07:19:23 AM »
I don't receive any responses on this topic that I constantly revive... Maybe here are smarter people willing to shed some light...

Topic :
http://www.cadtutor.net/forum/showthread.php?88563-Need-A-Lisp-for-3d-solid-pipe-length

Regards, M.R.
 :blank:
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

JohnK

  • Administrator
  • Seagull
  • Posts: 10625
Re: If you are smart...
« Reply #1 on: September 18, 2014, 07:28:50 AM »
That's a great way to get help; tell people they are smart if they can solve your problem.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

ribarm

  • Gator
  • Posts: 3255
  • Marko Ribar, architect
Re: If you are smart...
« Reply #2 on: September 18, 2014, 07:38:59 AM »
The problem isn't mine, it's everyone's that is using AutoCAD... I solved it in a way I could, but I avoided to answer directly on concrete question, because I didn't know the answer...
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

RC

  • Guest
Re: If you are smart...
« Reply #3 on: September 18, 2014, 10:21:48 AM »
use an application designed to construct pipe .... Autodesk Plant 3D (AutoCAD based) is currently the lead dog in that hunt, followed closely by AVEVA PDMS. 
For third party applications that run on top of AutoCAD: CadWorx Plant Design from Intergraph is probably the the best, but there are several in that field that are competitive.

Any pipe-centric application will also include an isometric generator of some kind, eliminating the time required to generate iso's for fabrication.

If you're smart :?, you buy proven applications that already exist instead of building them from scratch and spending hours debugging.    :evil:

dgorsman

  • Water Moccasin
  • Posts: 2437
Re: If you are smart...
« Reply #4 on: September 18, 2014, 10:39:36 AM »
I' tend to agree: get a professionally designed package.  Or at the very least have extensive experience in multiple products so already-proven methods can be adopted in a custom design.

And judging by constant attempts to turn AutoCAD into a dedicated architectural and/or civil package, not everyone is doing piping design.   :wink:
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}

ribarm

  • Gator
  • Posts: 3255
  • Marko Ribar, architect
Re: If you are smart...
« Reply #5 on: September 18, 2014, 01:53:57 PM »
I appreciate your suggestions and kind words, but still that's not the answer on very concrete question... How to obtain length value from Geometry property of sweep 3D SOLIDs, or how to obtain any property from Property toolbar?
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

RC

  • Guest
Re: If you are smart...
« Reply #6 on: September 18, 2014, 02:59:51 PM »
That is a wholly different question.  You link requires me to login to cadtutor so I haven't (and won't) look at the question over there. 

Your question HERE was related to 'length of 'PIPE'', sorry I can't answer your question related to 3DSOLIDS and lisp. Basic tools in autolisp are not very friendly with 3DSOLIDS.

dgorsman

  • Water Moccasin
  • Posts: 2437
Re: If you are smart...
« Reply #7 on: September 18, 2014, 04:06:30 PM »
I appreciate your suggestions and kind words, but still that's not the answer on very concrete question... How to obtain length value from Geometry property of sweep 3D SOLIDs, or how to obtain any property from Property toolbar?

Since its difficult to do so, I simply wouldn't rely on the realtime dimensions of an arbitrary solid.  I'd determine the specific properties of components during the program design process and find a consistent method of working with that data.
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}

VovKa

  • Water Moccasin
  • Posts: 1628
  • Ukraine
Re: If you are smart...
« Reply #8 on: September 19, 2014, 04:09:29 PM »
a guess all answers are here -> http://paulbourke.net/dataformats/sat/sat.pdf

GP

  • Newt
  • Posts: 83
  • Vercelli, Italy
Re: If you are smart...
« Reply #9 on: September 21, 2014, 06:02:08 PM »
While waiting for a solution to be revealed, I suggest this inelegant way to find the "approximate" length of a sweep solid created with sweep path = polyline.

Code: [Select]
(defun c:test (/ S EL S2 SS Reg n S1 eS A_ L)
    (vl-load-com)
    (if
        (and
            (princ "\nSelect a 3D SOLID created with SWEEP command")
            (setq S (ssget  "_+.:S" '((0 . "3DSOLID"))))
            (setq S (ssname S 0))
            (eq (vla-get-SolidType (vlax-ename->vla-object S)) "Sweep")
        )
        (progn
            (setq EL (entlast))
            (setq SS (ssadd))
            (command "_copy" S "" "_non" "0,0" "_non" "0,0")
            (setq S2 (entlast))
            (command "_explode" S2)
            (while EL
                (if (setq EL (entnext EL)) (ssadd EL SS))    
            )
            (setq Reg (ssadd))
            (repeat (setq n (sslength SS))
                (setq S1 (ssname SS (setq n (1- n))))
                (setq eS (cdr (assoc 0 (entget S1))))
                (if (= eS "REGION") (setq Reg (ssadd S1 Reg)))
            )
            (if (= 2 (sslength Reg))
                (progn               
                    (setq A_ (vla-get-area (vlax-ename->vla-object (ssname Reg 1))))
                    (setq L (/ (vla-get-volume (vlax-ename->vla-object S)) A_))
                )
            )
            (vl-cmdf "_erase" SS "" )
            (princ (strcat "\nLength of the sweep solid: " (rtos L)))
            (princ)
        )
    )
)

ribarm

  • Gator
  • Posts: 3255
  • Marko Ribar, architect
Re: If you are smart...
« Reply #10 on: September 22, 2014, 01:38:58 AM »
Thanks, GP... I thought ab that approach, but it's again not the answer... What will you do with closed sweeps, and I need info for all other possible parameters from Property toolbar...
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

allisonj050

  • Guest
Re: If you are smart...
« Reply #11 on: September 22, 2014, 10:50:52 AM »
I don't receive any responses on this topic that I constantly revive... Maybe here are smarter people willing to shed some light...

Topic :
http://www.cadtutor.net/forum/showthread.php?88563-Need-A-Lisp-for-3d-solid-pipe-length

Regards, M.R.
 :blank:

Do you have another link?  It doesn't seem to load for me.   :-D

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: If you are smart...
« Reply #12 on: September 22, 2014, 11:50:13 AM »
Link works for me. maybe you have to be a member of that site before the link will work.
I've reached the age where the happy hour is a nap. ()
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

allisonj050

  • Guest
Re: If you are smart...
« Reply #13 on: September 24, 2014, 09:47:58 AM »
maybe you have to be a member of that site before the link will work. The website link works just fine on my end.

Sorry, the issue was on my end.   :oops:  Link does work.   :-D
« Last Edit: November 14, 2014, 02:22:53 PM by allisonj050 »

chlh_jd

  • Guest
Re: If you are smart...
« Reply #14 on: September 25, 2014, 12:46:47 PM »
Nice Solution , GP  :-)

Is there another way to rebuild sweep's path entity or get it ?
Following is dxf code of a sweep entity's  dxf 350 . It seem that if can use Acad Interface method to read the path entity binary , will get the curve length .

Code - Auto/Visual Lisp: [Select]
  1. ;; dxf code 350 of Sweep3DSolid
  2. ((-1 . <&#22270;&#20803;&#21517;: 7ffff705980>);_ (handent (ss-dec2bas 16 (1+(ss-bas2dec 16 "24F"))))
  3.   (0 . "ACSH_SWEEP_CLASS")
  4.   (330 . <&#22270;&#20803;&#21517;: 7ffff705990>)
  5.   (5 . "250");_ (ss-dec2bas 16 (1+(ss-bas2dec 16 (cdr (assoc 5 (entget <SweepEname>))))))
  6.   (100 . "AcDbEvalExpr")
  7.   (90 . 1);_ Proxy capabilities flag. Bit-coded value that indicates the capabilities of this object as a proxy:
  8.                 ;_ 0 = No operations allowed (0)
  9.                 ;_ 1 = Erase allowed (0x1)
  10.                 ;_ 2 = Transform allowed (0x2)
  11.                 ;_ 4 = Color change allowed (0x4)
  12.                 ;_ 8 = Layer change allowed (0x8)
  13.                 ;_ 16 = Linetype change allowed (0x10)
  14.                 ;_ 32 = Linetype scale change allowed (0x20)
  15.                 ;_ 64 = Visibility change allowed (0x40)
  16.                 ;_ 128 = Cloning allowed (0x80)
  17.                 ;_ 256 = Lineweight change allowed (0x100)
  18.                 ;_ 512 = Plot Style Name change allowed (0x200)
  19.                 ;_ 895 = All operations except cloning allowed (0x37F)
  20.                 ;_ 1023 = All operations allowed (0x3FF)
  21.                 ;_ 1024 = Disables proxy warning dialog (0x400)
  22.                 ;_ 32768 = R13 format proxy (0x8000)
  23.   (98 . 29);_ Standard/title/header row unit type
  24.   (99 . 38)
  25.  
  26.   (100 . "AcDbShHistoryNode")
  27.   (90 . 29)
  28.   (91 . 38);_
  29.  
  30.   (40 . 1.0);_Transform matrix of sweep entity (16 reals; row major format; default = identity matrix)
  31.   (41 . 0.0)
  32.   (42 . 0.0)
  33.   (43 . 0.0)
  34.   (44 . 0.0)
  35.   (45 . 1.0)
  36.   (46 . 0.0)
  37.   (47 . 0.0)
  38.   (48 . 0.0)
  39.   (49 . 0.0)
  40.   (50 . 1.0)
  41.   (51 . 0.0)
  42.   (52 . 0.0)
  43.   (53 . 0.0)
  44.   (54 . 0.0)
  45.   (55 . 1.0);_--> TMat '((1.0 0. 0. 0.) (0. 1. 0. 0.) (0. 0. 1. 0.) (0. 0. 0. 1.))
  46.  
  47.   (62 . 256);_ color
  48.  
  49.   (92 . 0);_
  50.  
  51.   (347 . <&#22270;&#20803;&#21517;: 7ffff703de0>);_ Material Entity
  52.  
  53.   (100 . "AcDbShPrimitive")
  54.  
  55.   (100 . "AcDbShSweepBase")
  56.   (90 . 29)
  57.   (91 . 38)
  58.   (10 0.0 0.0 0.0)
  59.   (92 . 18);_ Class ID of sweep entity  
  60.   (90 . 336);_Size of binary data
  61.   (310 . "137C0363305E33900313BE1088CC7C54083080BDF1DCEF8A400F4F4560B47B7BCFC5A4E81F4E60BB1BF8CC");_ binary of sweep entity        
  62.   (93 . 77);_ Class ID of path entity  
  63.   (90 . 2240);_Size of binary data
  64.   ;; binary of path entity , This part is the key data , how to translate it into entity ?
  65.   (310
  66.     .
  67.     "4410E43937C0363305E33900C4EF8422331F1502F2409C7071E79501E38E1752DC53090383CFB3ADBBFB950155BC5AFA6C1F110383CFB3ADBBFB95020E8FE473CC5F9D0383CFB3ADBA0795020E8FE473CE539D0103FE2BE7BCFEFD020E8FE473CE539D00FBFE2BE7BD5EED020E8FE473CC5F9D00FBFE2BE7BD5EED004AD95D")
  68.   (310
  69.     .
  70.     "44440F8100FBFE2BE7BCFEFD0095B2BE8888337D004AF4E32DA62B810095B2BE8888337D004AF4E32DA41F850095B2BE88884B79004AF4E32DA41F8501BA4BB33C07FF51004AF4E32DA62B8101BA4BB33C0417510265E8452A63430501BA4BB33C041751020EBB41EFA03136CFE0CBBFF265E60B68FE0CBBFF265E60B68FE0")
  71.   (310 . "CBBFF265E60B68FE0CBBFF265E60B6AFE0CBBFF265E60B6AFE8CCC")
  72.  
  73.   (42 . 0.0);_ Draft angle (in radians)
  74.   (43 . 0.0);_ Draft start distance
  75.   (44 . 0.0);_ Draft end distance
  76.   (45 . 0.0);_ Twist angle
  77.   (48 . 1.0);_ Scale factor
  78.   (49 . 0.0);_ Align angle (in radians)
  79.  
  80.  ;; Transform matrix of sweep entity (16 reals; row major format; default = identity matrix)
  81.   (46 . 1.0)
  82.   (46 . 0.0)
  83.   (46 . 0.0)
  84.   (46 . 13449.0)
  85.   (46 . 0.0)
  86.   (46 . 1.0)
  87.   (46 . 0.0)
  88.   (46 . 2789.99)
  89.   (46 . 0.0)
  90.   (46 . 0.0)
  91.   (46 . 1.0)
  92.   (46 . 0.0)
  93.   (46 . 0.0)
  94.   (46 . 0.0)
  95.   (46 . 0.0)
  96.   (46 . 1.0);_ -> ((1. 0. 0. 13449.0) (0. 1. 0. 2789.99) (0. 1. 0. 0.) (0. 0. 0. 1.))
  97.  
  98.  ;; Transform matrix of path entity (16 reals; row major format; default = identity matrix)
  99.   (47 . 0.0665879)
  100.   (47 . 0.0)
  101.   (47 . 0.997781)
  102.   (47 . 15601.5)
  103.   (47 . 0.997781)
  104.   (47 . 0.0)
  105.   (47 . -0.0665879)
  106.   (47 . 11151.1)
  107.   (47 . 0.0)
  108.   (47 . 1.0)
  109.   (47 . 0.0)
  110.   (47 . 0.0)
  111.   (47 . 0.0)
  112.   (47 . 0.0)
  113.   (47 . 0.0)
  114.   (47 . 1.0);_-> (( 0.0665879 0. 0.997781 15601.5) (0.997781 0. -0.0665879 11151.1) (0. 1. 0. 0.) (0. 0. 0. 1.))
  115.  
  116.   (290 . 1);_ Solid flag
  117.   (70 . 1);_ Sweep alignment option
  118.                 ;_ 0 = No alignment
  119.                 ;_ 1 = Align sweep entity to path
  120.                 ;_ 2 = Translate sweep entity to path
  121.                 ;_ 3 = Translate path to sweep entity
  122.   (71 . 2)
  123.   (292 . 1);_ Align start flag
  124.   (293 . 0);_ Bank flag
  125.   (294 . 0);_ Base point set flag
  126.   (295 . 1);_ Sweep entity transform computed flag
  127.   (296 . 1);_ Path entity transform computed flag
  128.   (11 0.0 0.0 0.0);_ (11 21 31) Reference vector for controlling twist
  129.   (100 . "AcDbShSweep"))
  130.  
  131.