This is a new question, but extended from my previous one: https://forums.autodesk.com/t5/autocad-civil-3d-forum/sac-question/td-p/7807476
How can I tell the corridor to search for a target only out, say, 10 feet?
This isn't for targeting anything physical. It's for an .isvalid switch.
There needs to be better vernacular for this stuff. Or I need to learn it if it exists. I've spent a lot of time searching for "Target Offset" and getting not what will help me.
I've made a simple drawing and took a screenshot to illustrate. The assembly is default 1' high but, when it encounters the polyline on the magic layer, it changes to 10' high. You can see, it searches across the 100' gulf between the alignment. I need it to not do that.
I'll also attach a screenshot where @KMercier_C3D answered someone's question about this, but I believe that is an ootb SA(?) How do I add that functionality to my custom SA?
Thanks!
Solved! Go to Solution.
Solved by KMercier_C3D. Go to Solution.
Solved by KMercier_C3D. Go to 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®
Hi Jeff,
I absolutely agree with Kati's suggestion above. Just want to add this sample PKT that will guide you to the process (I took it from your other post). Please consider adding Variable Absolute and add Kati's suggestion above.
if(Increase.isvalid,If(AL1.XLength<=ATargetLimit,-ABig,-ANorm),-ANorm) <- You can see this in the attached PKT and all A means I converted them as absolute value.
Cheers,
Jowenn
Jowenn Lua | Retired Account See My New Profile Here
AU 2023 CES600726 – Getting Started with Generative Design in Civil 3D: A Beginner’s Guide
AU 2020 CES473668 – Supercharge Your Dynamo Graph with Civil 3D Toolkit
AU 2019 CES319333 – Dynamo in Civil 3D Introduction Unlocking the mystery of scripting
AU 2018 CI225967 – Using Automation in Civil 3D for Construction Documentation and Exports
AU 2017 CI123653 – AutoCAD Civil 3D and Subassembly Composer— Real-World-Practice Tips and Tricks
I got that to work. Thanks. But I didn't ask for enough, apparently. I need this to work when there's an Increase or an IncreaseMore. (The two never meet, so it is really an "or".)
I've been banging slightly different versions of this in and can't get that red "!" to go away. Why won't this work?
if (Increase.isvalid, if(AL1.xlength<10, Big, if (IncreaseMore.isvalid, if(AL1.xlength<10, Bigger, Norm), Norm), Norm))
In English: "If you find the polyline on the magic "Increase" layer and its within 10' of the centerline, use the "Big" value for this Delta Y. Or if you find a polyline on the magic IncreaseMore layer and its within 10' of centerline, use the "Bigger" value for this Delta Y. If you don't find either of them suckers, just use the "Norm" value.
...And I can do this with just one AL1, right? Or do I need another one to target the IncreaseMore? Maybe I do. But I don't think that's the problem with the if-then code.
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®
I appreciate you taking a stab, @KMercier_C3D. That didn't work.
BTW, the attachment pkt to my last post had TargetParameter2 instead of IncreaseMore. It keeps forgetting its name. But I've changed it and that's not the problem, it would seem.
Oh! But hovering over that red "!" tells you stuff! How nice. It says that my "if" operator requires either two or three operands. Wonder where a guy can get operands this time o' night?
Hi Jeff,
Please see attached PKT. I think what you intend to do is have 2 possible target and horizontal limit as well. I would normally choose 1 target and use offset alignment with value to control them but this would also work but you will need to possible target instead of one.
See before if they are parallel, the bigger will also be a target in both side. So adding target limit is needed.
Idea now, you can have 1 target exist then it will check if it is within distance range. Then if both exist bigger over rule but will check distance of bigger as well.
Codes is so long now.. It looks like this 🙂
if(IncreaseMore.isvalid,if(AL2.XLength<=AIncMoreMaxLimit,-ABigger,if(Increase.isvalid,if(AL1.XLength<=AIncMaxLimit,-ABig,-ANorm),-ANorm)),if(Increase.isvalid,if(AL1.XLength<=AIncMaxLimit,-ABig,-ANorm),-ANorm))
Cheers,
Jowenn
Jowenn Lua | Retired Account See My New Profile Here
AU 2023 CES600726 – Getting Started with Generative Design in Civil 3D: A Beginner’s Guide
AU 2020 CES473668 – Supercharge Your Dynamo Graph with Civil 3D Toolkit
AU 2019 CES319333 – Dynamo in Civil 3D Introduction Unlocking the mystery of scripting
AU 2018 CI225967 – Using Automation in Civil 3D for Construction Documentation and Exports
AU 2017 CI123653 – AutoCAD Civil 3D and Subassembly Composer— Real-World-Practice Tips and Tricks
Here is another possible solution. AP1&AL1 are on Increase. AP2&AL2 are on IncreaseMore.
The test equation looks like this: if ((Increase.isvalid)AND(AL1.xlength<=10), Big, if((IncreaseMore.isvalid)AND(AL2.xlength<=10), Bigger, Norm))
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®
Again, you've made my day, @KMercier_C3D!
Here's some notes:
I initially tested both Jowenn's and Kati's SAs. For each of the SAs I did the following:
Neither worked.
"What are the chances they both got it wrong?" I asked myself. Pretty slim. So, on a hunch I changed the name of the SAs under Packet Settings from "Test11" to "Jowenn" and "Kati".
Jowenn's - When I tested this as "Test11" the corridor would change from Norm to Big, but it would change by the same amount (Big) whether the Increase or IncreaseMore was present, and no matter how far away. This is the same behavior as the original Test11 that was present in the drawing. After renaming it "Jowenn", it was obviously acting differently than when it was named "Test11", but it would not change in any situation from Norm. I chalk this up to (maybe) needing to specify somehow what the maxdistance is? I'm not sure. But I'd bet the problem with this is more on my end than Jowenn's.
Kati's - When I tested as "Test11" it acted just as Jowenn's when named "Test11". But when I renamed it to "Kati" it acted as desired (to much rejoicing).
So, I'm led to conclude, and it's fairly obvious to me now that I've written this out, that the "Test11" which I originally had in the dwg was not actually erased and then replaced by the SAs imported with the same name. (Even after purging all in the drawing, if I brought a "Test11" back in, it still exhibited the same behavior.) This probably is a known thing and I happened to stumble upon it. Glad I did relatively early. Please enlighten me if I've got this wrong, but I tested several times.
Jowenn's post warrants further consideration. I can see how the interface may be cleaner (and may lead to 0001 functionality in the transitions if and when I ever get to the point where I fully understand his video) if I target one polyline and use the offset distance of that polyline to switch the input parameter variables. But I can't wrap my head around the if-then statement(s) that would allow that to happen. I will hopefully revisit this idea. But for today I've got a lot of if-then statements to copy-and-paste and a lot of subassemblies to rename.
Thanks again.
Can't find what you're looking for? Ask the community or share your knowledge.