Community
Civil 3D Forum
Welcome to Autodesk’s Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Use Subassembly Composer to iterate a solution

17 REPLIES 17
Reply
Message 1 of 18
tcorey
2702 Views, 17 Replies

Use Subassembly Composer to iterate a solution

Hello all,

 

Here's the situation in our levee design:

 

On the left side of the existing levee is a hinge line. That needs to be the limits of the grading (daylight left, if you will) on that side when we build the new levee.

 

The design and control for the new levee embankment is going to be a point that follows roughly parallel to the existing right side hinge.

 

We want to be able to start at the point on the right and then run a course of links until we get to the daylight on the left.

 

Easy enough, except that many times on the left side, because of an irregular existing hinge line, we won't catch.

 

When we don't catch, we want to move the entire design right one foot, follow the same course as before and check for catch again.

 

If it doesn't catch, move over another one foot and try it again, and again, and again as needed. Phew.

 

I've already proven to myself that I can brute-force this thing in there using decisions and sequences, but I'll be building decisions and sequences for a long time and my subassembly is going to be artistically ugly.

 

There has to be a more elegant way. If you have one, please let me know.

 

Best regards,

 

Tim

 

Oh, and thanks!



Tim Corey
MicroCAD Training and Consulting, Inc.
Redding, CA
Autodesk Gold Reseller

New knowledge is the most valuable commodity on earth. -- Kurt Vonnegut
17 REPLIES 17
Message 2 of 18
jon_b
in reply to: tcorey

This is purely theoretical, but have a custom subassembly that takes an input value as the distance to shift over then runs your iteration.  If it fails, increment the distance it needs to shift over and provide that as output (possibly also provide an output value on success).  Then have the identical custom subassembly after it read that value via the Parameter Reference on the assembly properties' construction tab to redo the test, and uses the secondary value or some other unique identifier to ignore the test as it was already successful.  Stack up the subassemblies as many levels as needed with each passing up the value required to shift over.

Message 3 of 18
tcorey
in reply to: tcorey

Sounds like I need a 'do while' loop function. Does that exist in SAC? At the very least, this is turning into a learning opportunity. I promise to post any progress.


Tim Corey
MicroCAD Training and Consulting, Inc.
Redding, CA
Autodesk Gold Reseller

New knowledge is the most valuable commodity on earth. -- Kurt Vonnegut
Message 4 of 18
jon_b
in reply to: tcorey

No loops in SAC, spec'd by Autodesk possibly to prevent endless loops.

 

Attached is a subassembly I composed that does part of what I suggested and shows the testing aspect, used to excavate a tiered support slope for a channel.  It tests to see if there is a surface above or below a desired point, then either puts in a lift and bench or daylights to the surface.  I stacked about 6 or so of these on top of each other to go through an area that varied from about 5m of cut to +40m.  At one time I had an output parameter if the surface had already been daylighted to that would be passed to the next subassembly up, but in the end I didn't need it and removed it.

Message 5 of 18
KMercier_C3D
in reply to: tcorey

jon_b is right that there isn't any "do while" loop functions in SAC but there may be another solution. Can you provide a quick sketch of a scenario or two to explain better what you are trying to do?


Kati Mercier, P.E. | LinkedIn | AutoCAD Civil 3D Certified Professional
Pronouns: She/Her
Co-author of "Mastering AutoCAD Civil 3D 2013"
AU2019 Speaker::: CES321590: Analyze and Revise Existing Subassembly Composer PKT Files for AutoCAD Civil 3D
AU2017 Speaker::: CI125544: Analyze and Devise in Subassembly Composer
AU2012 Speaker::: CI3001: Reverse Engineering with Subassembly Composer for AutoCAD Civil 3D
AU2011 Speaker::: CI4252: Create Subassemblies That Think Outside the Box With Subassembly Composer for AutoCAD® Civil 3D®

Message 6 of 18
tcorey
in reply to: KMercier_C3D

Hi Kati,

 

I didn't want to address my original message to you by name -- I know you're a busy professional -- but I was secretly hoping you'd chime in. 🙂

 

The attached sketch is similar to what we are trying to do. Situation A is normal, we catch on the left. Situation B causes no catch on the left.

 

What we want to do is if situation B arises, slide the entire SAC-composed subassembly 1' to the right and test again. If it still doesn't catch, do it again, and so on.

 

I have been able to brute-force this into working by building several layers of Decisions (using a P2.isvalid test.) It works but it doesn't seem very elegant. What if I need to iterate to the right 12 feet when I've only built in ten levels of decisions? 

 

I am looking for a more elegant, more streamlined solution than what I came up with when I first sat down to tackle this. If it was a program, I'd set up a loop and let it run until p2.isvalid tests out as true.

 

If you have a way to do this, I will be in your debt. (I already am. You don't know how many times your posts and AU papers have helped me through an issue.)

 

Best regards,

 

Tim

 



Tim Corey
MicroCAD Training and Consulting, Inc.
Redding, CA
Autodesk Gold Reseller

New knowledge is the most valuable commodity on earth. -- Kurt Vonnegut
Message 7 of 18
doni49
in reply to: tcorey

Tim,

 

What portions of that are known at design time and what poritons can vary?



Don Ireland
Engineering Design Technician




If a reply solves your issue, please remember to click on "Accept as Solution". This will help other users looking to solve a similar issue. Thank you.


Please do not send a PM asking for assistance. That's what the forums are for. This allows everyone to benefit from the question asked and the answers given.

Message 8 of 18
KMercier_C3D
in reply to: tcorey

So the first two links stay the same but the starting point would be shifted to the right? Does this continue to follow the same profile? How is this defined for construction?

Still trying to wrap my head around a possible solution.


Kati Mercier, P.E. | LinkedIn | AutoCAD Civil 3D Certified Professional
Pronouns: She/Her
Co-author of "Mastering AutoCAD Civil 3D 2013"
AU2019 Speaker::: CES321590: Analyze and Revise Existing Subassembly Composer PKT Files for AutoCAD Civil 3D
AU2017 Speaker::: CI125544: Analyze and Devise in Subassembly Composer
AU2012 Speaker::: CI3001: Reverse Engineering with Subassembly Composer for AutoCAD Civil 3D
AU2011 Speaker::: CI4252: Create Subassemblies That Think Outside the Box With Subassembly Composer for AutoCAD® Civil 3D®

Message 9 of 18
tcorey
in reply to: KMercier_C3D

The entire shape remains the same. If we don't catch on the left,  because that's the water side and our surface border is at existing left hinge, we want to shift the origin point right one foot and try again, and again, etc. until we catch.

 

This is a first run situation where the engineer wants to see which sections require how much shift and then he plans to come back through and generalize a final design alignment that allows the left to always catch while taking out some of the jaggedness that this solution is bound to cause.

 

To all, I am not looking for a solution that requires me to make create many decisions and sequences in the SAC. I can already solve this situation doing that. I am looking for something more elegant. If I need to move over eight times, I don't want to manually put eight decisions and sequences. I want one logic program that does it for me.



Tim Corey
MicroCAD Training and Consulting, Inc.
Redding, CA
Autodesk Gold Reseller

New knowledge is the most valuable commodity on earth. -- Kurt Vonnegut
Message 10 of 18
KMercier_C3D
in reply to: tcorey

Replying from my phone so forgive me for not being able to pull up your sketch from before but I think I have a one iteration solution (yay for eureka moments while driving home).

Make target offset using polyline extracted from surface boundary

AP1 at start.
AP2 at first link end point
AP3 at second line end point
AP4 try to daylight to surface
AP5 on surface at target offset
Decision if AP4.isvalid
-true then put P's at all of AP1 through AP4
-false start at left instead of right. P4 is at AP5. AP6 using OPPOSITE of first link (so down and right instead of up and left). AP7 using OPPOSITE of second link. AP8 daylight to surface using opposite of last link. (This is all similar triangles and all that jazz.). No define P1 at AP8 and P2 using first link geometry and P3 using second link geometry (P4 was already designed).

Tada! (Maybe?)


Kati Mercier, P.E. | LinkedIn | AutoCAD Civil 3D Certified Professional
Pronouns: She/Her
Co-author of "Mastering AutoCAD Civil 3D 2013"
AU2019 Speaker::: CES321590: Analyze and Revise Existing Subassembly Composer PKT Files for AutoCAD Civil 3D
AU2017 Speaker::: CI125544: Analyze and Devise in Subassembly Composer
AU2012 Speaker::: CI3001: Reverse Engineering with Subassembly Composer for AutoCAD Civil 3D
AU2011 Speaker::: CI4252: Create Subassemblies That Think Outside the Box With Subassembly Composer for AutoCAD® Civil 3D®

Message 11 of 18
tcorey
in reply to: tcorey

Thanks, Kati. I didn't expect you to spend your valuable drive time on this, but I appreciate it. You are a great asset in this community.

 

Your solution gets me closer, but still doesn't provide the engineer's request to move over exactly 1' each iteration.

 

I'm going to just brute-force it for now so he can at least have something that works.

 

Autodesk sent me a message that they have created a support case on this (I didn't submit one!) so there is still hope.

 

If they do come up with a solution, I will be sure to post here. Sharing is caring. 😉

 

Best regards to all,

 

Tim

 

p/s Is there a guide that helps with the use of VB statements within SAC? Something that covers most-to-all available functions?

 

 



Tim Corey
MicroCAD Training and Consulting, Inc.
Redding, CA
Autodesk Gold Reseller

New knowledge is the most valuable commodity on earth. -- Kurt Vonnegut
Message 12 of 18
KMercier_C3D
in reply to: tcorey

Curious if the engineer just asked for 1' iterations because they didn't expect you to iterate at hundredths of a foot to get a more fluid result. But if they do want a jagged result with 1' iterations then on false don't define P4 right away and at AP8 instead of defining P1 there then instead put P1 at a delta x from origin equal to math.ceiling(AP.8) and then calculate the rest from there. P4 should now catch.

There is a summary of all of the API functions available (including the math ones) in the back of each of my AU handouts downloadable from the website.


Kati Mercier, P.E. | LinkedIn | AutoCAD Civil 3D Certified Professional
Pronouns: She/Her
Co-author of "Mastering AutoCAD Civil 3D 2013"
AU2019 Speaker::: CES321590: Analyze and Revise Existing Subassembly Composer PKT Files for AutoCAD Civil 3D
AU2017 Speaker::: CI125544: Analyze and Devise in Subassembly Composer
AU2012 Speaker::: CI3001: Reverse Engineering with Subassembly Composer for AutoCAD Civil 3D
AU2011 Speaker::: CI4252: Create Subassemblies That Think Outside the Box With Subassembly Composer for AutoCAD® Civil 3D®

Message 13 of 18
tcorey
in reply to: KMercier_C3D

Kati, I think I can use your original method but round the distance from AP4 to AP5 up to the nearest integer and then apply that as a variable to the X offset value of my new subassy startpoint. I'm going to give that a shot later today (exciting Saturday!) and will report back.

 

Thanks,

 

Tim



Tim Corey
MicroCAD Training and Consulting, Inc.
Redding, CA
Autodesk Gold Reseller

New knowledge is the most valuable commodity on earth. -- Kurt Vonnegut
Message 14 of 18
doni49
in reply to: tcorey

TIm,

 

I'm betting that if you told them about it, you'd find that they think this is EVEN BETTER than they imagined possible and that they only asked for 1' intervals because they didn't think you'd be able to give them better.



Don Ireland
Engineering Design Technician




If a reply solves your issue, please remember to click on "Accept as Solution". This will help other users looking to solve a similar issue. Thank you.


Please do not send a PM asking for assistance. That's what the forums are for. This allows everyone to benefit from the question asked and the answers given.

Message 15 of 18
KMercier_C3D
in reply to: tcorey

Typo. Should have typed math.ceiling(AP8.X)


Kati Mercier, P.E. | LinkedIn | AutoCAD Civil 3D Certified Professional
Pronouns: She/Her
Co-author of "Mastering AutoCAD Civil 3D 2013"
AU2019 Speaker::: CES321590: Analyze and Revise Existing Subassembly Composer PKT Files for AutoCAD Civil 3D
AU2017 Speaker::: CI125544: Analyze and Devise in Subassembly Composer
AU2012 Speaker::: CI3001: Reverse Engineering with Subassembly Composer for AutoCAD Civil 3D
AU2011 Speaker::: CI4252: Create Subassemblies That Think Outside the Box With Subassembly Composer for AutoCAD® Civil 3D®

Message 16 of 18
tcorey
in reply to: doni49


@doni49 wrote:

TIm,

 

I'm betting that if you told them about it, you'd find that they think this is EVEN BETTER than they imagined possible and that they only asked for 1' intervals because they didn't think you'd be able to give them better.


That's probably true. I'll find out tomorrow.



Tim Corey
MicroCAD Training and Consulting, Inc.
Redding, CA
Autodesk Gold Reseller

New knowledge is the most valuable commodity on earth. -- Kurt Vonnegut
Message 17 of 18
doni49
in reply to: KMercier_C3D

Kati,

 

I have to say that I really enjoy reading the solutions you come up with -- ESPECIALLY for SAC on the more complicated cases.  I learn so much from your posts.



Don Ireland
Engineering Design Technician




If a reply solves your issue, please remember to click on "Accept as Solution". This will help other users looking to solve a similar issue. Thank you.


Please do not send a PM asking for assistance. That's what the forums are for. This allows everyone to benefit from the question asked and the answers given.

Message 18 of 18
tcorey
in reply to: KMercier_C3D

A tried Kati's method Sunday evening and it works perfectly. Thanks thanks thanks!

 

Best regards,

 

Tim



Tim Corey
MicroCAD Training and Consulting, Inc.
Redding, CA
Autodesk Gold Reseller

New knowledge is the most valuable commodity on earth. -- Kurt Vonnegut

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


 

Autodesk Design & Make Report