Author Topic: C3D 2012 - Apply rules to more than 1 pipe  (Read 7151 times)

0 Members and 1 Guest are viewing this topic.

Matt__W

  • Seagull
  • Posts: 12955
  • I like my water diluted.
C3D 2012 - Apply rules to more than 1 pipe
« on: December 11, 2012, 12:34:06 PM »
Is it possible to apply a rule to more than 1 pipe at a time?  Or even the entire network?  I don't see any way to do this or any options that might control this.  Am I missing sumpin'??
Autodesk Expert Elite
Revit Subject Matter Expert (SME)
Owner/FAA sUAS Pilot @ http://skyviz.io

BlackBox

  • King Gator
  • Posts: 3770
Re: C3D 2012 - Apply rules to more than 1 pipe
« Reply #1 on: December 11, 2012, 01:36:23 PM »
Code - Auto/Visual Lisp: [Select]
  1. (defun c:ARM () (c:ApplyRulesMultiple))
  2. (defun c:ApplyRulesMultiple (/ ss)
  3.   (princ "\rApply rules to multiple Civil 3D parts: ")
  4.   (while (setq ss (ssget ":S:E:L" '((0 . "AECC_PIPE,AECC_STRUCTURE"))))
  5.     (sssetfirst nil ss)
  6.     (command "._ApplyRules")
  7.     (sssetfirst nil nil)
  8.   )
  9.   (princ)
  10. )
  11.  

... You can easily refine this to process a single selection set, etc..
« Last Edit: December 11, 2012, 01:40:03 PM by RenderMan »
"How we think determines what we do, and what we do determines what we get."

Matt__W

  • Seagull
  • Posts: 12955
  • I like my water diluted.
Re: C3D 2012 - Apply rules to more than 1 pipe
« Reply #2 on: December 11, 2012, 01:44:08 PM »
So in other words.... I WASN'T missing anything.   :lol:

Thanks for the option/solution!
Autodesk Expert Elite
Revit Subject Matter Expert (SME)
Owner/FAA sUAS Pilot @ http://skyviz.io

BlackBox

  • King Gator
  • Posts: 3770
Re: C3D 2012 - Apply rules to more than 1 pipe
« Reply #3 on: December 11, 2012, 01:48:26 PM »
Thanks for the option/solution!

No worries; I'm happy to help.



... You can easily refine this to process a single selection set, etc..

Here's another adaptation in kind:

Code - Auto/Visual Lisp: [Select]
  1. (defun c:ApplyRulesMultiple (/ ss ss2 i)
  2.   (princ "\rApply rules to multiple Civil 3D parts: ")
  3.   (if (and (setq ss (ssget "_:L" '((0 . "AECC_PIPE,AECC_STRUCTURE"))))
  4.            (setq ss2 (ssadd))
  5.       )
  6.     (repeat (setq i (sslength ss))
  7.       (sssetfirst
  8.         nil
  9.         (setq ss2 (ssadd (setq e (ssname ss (setq i (1- i)))) ss2))
  10.       )
  11.       (command "._ApplyRules")
  12.       (sssetfirst nil nil)
  13.       (setq ss2 (ssdel e ss2))
  14.     )
  15.   )
  16.   (princ)
  17. )
  18.  
"How we think determines what we do, and what we do determines what we get."

Matt__W

  • Seagull
  • Posts: 12955
  • I like my water diluted.
Re: C3D 2012 - Apply rules to more than 1 pipe
« Reply #4 on: December 11, 2012, 02:28:56 PM »
Thanks for the option/solution!

No worries; I'm happy to help.



... You can easily refine this to process a single selection set, etc..

Here's another adaptation in kind:

Code - Auto/Visual Lisp: [Select]
  1. (defun c:ApplyRulesMultiple (/ ss ss2 i)
  2.   (princ "\rApply rules to multiple Civil 3D parts: ")
  3.   (if (and (setq ss (ssget "_:L" '((0 . "AECC_PIPE,AECC_STRUCTURE"))))
  4.            (setq ss2 (ssadd))
  5.       )
  6.     (repeat (setq i (sslength ss))
  7.       (sssetfirst
  8.         nil
  9.         (setq ss2 (ssadd (setq e (ssname ss (setq i (1- i)))) ss2))
  10.       )
  11.       (command "._ApplyRules")
  12.       (sssetfirst nil nil)
  13.       (setq ss2 (ssdel e ss2))
  14.     )
  15.   )
  16.   (princ)
  17. )
  18.  

Thanks!  Saves me the trouble of having to do it myself!  #OutOfContextThread
Autodesk Expert Elite
Revit Subject Matter Expert (SME)
Owner/FAA sUAS Pilot @ http://skyviz.io

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: C3D 2012 - Apply rules to more than 1 pipe
« Reply #5 on: December 12, 2012, 01:03:41 AM »
APPLYRULES
Select up slope part in plan (Pipe or Structure):

This will do the entire network; if used properly
Be your Best


Michael Farrell
http://primeservicesglobal.com/

BlackBox

  • King Gator
  • Posts: 3770
Re: C3D 2012 - Apply rules to more than 1 pipe
« Reply #6 on: December 12, 2012, 08:35:59 AM »
APPLYRULES
Select up slope part in plan (Pipe or Structure):

This will do the entire network; if used properly

Interesting, that is only displayed when invoking the ApplyRules Command prior to selecting of a Pipe or Structure.

For the reverse (selecting a Pipe or Structure first), this is what's displayed:

Code: [Select]
Command: ApplyRules
Rules successfully applied to 1 network parts.

... not sure why first selecting 'up slope part' is so critical, when that information can be extracted programmatically.
"How we think determines what we do, and what we do determines what we get."

Jeff_M

  • King Gator
  • Posts: 4100
  • C3D user & customizer
Re: C3D 2012 - Apply rules to more than 1 pipe
« Reply #7 on: December 12, 2012, 05:11:15 PM »
... not sure why first selecting 'up slope part' is so critical, when that information can be extracted programmatically.
This may be of interest to you:
http://beingcivil.typepad.com/my_weblog/2012/01/cover-slope-pipe-rule.html

When I saw the lisp you posted, my first reaction was "I'm not so sure that's a good idea...". But maybe it works for you ok, I just recall all the behind the scenes stuff from that article making it seem like a bad idea.

BlackBox

  • King Gator
  • Posts: 3770
Re: C3D 2012 - Apply rules to more than 1 pipe
« Reply #8 on: December 12, 2012, 05:33:49 PM »
... not sure why first selecting 'up slope part' is so critical, when that information can be extracted programmatically.
This may be of interest to you:
http://beingcivil.typepad.com/my_weblog/2012/01/cover-slope-pipe-rule.html

When I saw the lisp you posted, my first reaction was "I'm not so sure that's a good idea...". But maybe it works for you ok, I just recall all the behind the scenes stuff from that article making it seem like a bad idea.

Too bad Autodesk didn't think this one through (and myriad others pertaining to pipes in general)... It's kind of hard to automate any pipe related workflow (albeit with LISP) when so much is incumbent upon the user starting on one side of the pipe network for it (the Civil 3D Command) to function properly. :| *Kicks dirt*
"How we think determines what we do, and what we do determines what we get."

Jeff_M

  • King Gator
  • Posts: 4100
  • C3D user & customizer
Re: C3D 2012 - Apply rules to more than 1 pipe
« Reply #9 on: December 12, 2012, 05:57:40 PM »
Actually, this is one piece that makes complete sense to me. Back before C3D, or LDT, or...., when we designed on paper, we most always started our design at the upstream point, using minimum cover, and worked downstream. We then analyzed how that fit whatever we had to tie in to and made adjustments accordingly. I think the C3D methodology is about the same. Now if you randomly select pipes and expect it to adjust each based on those connected to it, but then one later changes due to being later in the selection order, it would be a nightmare to control.

You do know you can select the upstream part, then select the LAST downstream part, and C3D will autoselect all those in between? This makes it so with 2 picks you can apply rules to a whole section.

reno

  • Guest
Re: C3D 2012 - Apply rules to more than 1 pipe
« Reply #10 on: December 30, 2012, 08:03:50 PM »
Interesting, that is only displayed when invoking the ApplyRules Command prior to selecting of a Pipe or Structure.

if you select multiple pipes/structures and run the command it will ask you to select the upstream part. if you have only one part selected, the rules are applied to that part. if you have no parts or multiple parts selected, it will ask you which parts to apply the rules to.