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

subassembly composer math expression

1 REPLY 1
Reply
Message 1 of 2
_yass
3601 Views, 1 Reply

subassembly composer math expression

Hi,

I would find someting like a list of math expression for "decision" situation. I understand the basic one, but is pretty more difficult when i try expression with "if" for exemple.

In a pratical exemple: If P1-P2 is between 2 values = true/false

THX

ps: Sorry for my poor english 

1 REPLY 1
Message 2 of 2
joantopo
in reply to: _yass

Conditional Logic Operators
There are numerous conditional logic operators that you will want to be familiar with as you
define decision conditions. Examples of these include:
> or < P1.Y>P2.Y (or P1.Y<P2.Y) returns True if P1.Y is greater than (or less than) P2.Y.
>= or <= P1.Y>=P2.Y (or P1.Y<=P2.Y) returns True if P1.Y is greater than or equal to (or
less than or equal to) P2.Y.
= or <> P1.Y=P2.Y (or P1.Y<>P2.Y) returns True if P1.Y is equal to (or not equal to) P2.Y.
AND P1.Y>P2.Y)AND(P2.X>P3.X) returns True if both the first condition located in a pair of
parentheses and the second condition located in a pair of parentheses are true.
OR (P1.Y>P2.Y)OR(P2.X>P3.X) returns True as long as at least one of the conditions
located in either pair of parentheses is true.
XOR (P1.Y>P2.Y)XOR(P2.X>P3.X) returns True if one of the conditions located in a pair of
parentheses is true and the other condition located in a pair of parentheses is false.
Any of these operators could also be used in an If statement within any expression in order
to test a condition and provide one of two different values.
In the following example expression for a slope value, the distance from auxiliary point AP1
to the target surface is calculated. If it is greater than 0, meaning that AP1 is located above the
surface (in fill), then the slope value will be –0.25. If the value is not greater than 0, meaning that
AP1 is located below the surface (in cut), then the slope value will be 0.33.
IF(AP1.DistanceToSurface(TargetSurface)>0,-0.25,0.33)
With a combination of the right conditional logic operators, you can make all kinds of decisions.
 

 

from "Bonus Chapter 1  Custom Subassemblies":   (page 33)

http://media.johnwiley.com.au/product_ancillary/18/11186038/DOWNLOAD/603819bc01.pdf

Autocad C3D 2019 SP3, 2020 & 2021
Intel I9 9900K with frontal watercooler alphacool eisbaer 360 (original fans mounted in pull)- 3 fans Corsair 120 ML PRO in push.
MOBO Gygabyte Z390 Aorus Master- Corsair RGB Vengeance 64GB RAM (4x16) CL16
Nvidia Quadro RTX 4000
Samsung 970 EVO PLUS 1TB (unit C). Samsung 970 PRO 512GB (for data)
Power Supply: Corsair TX850M PLUS


Descubre mi programa VisorNET para Civil 3D:
https://apps.autodesk.com/CIV3D/es/Detail/Index?id=appstore.exchange.autodesk.com%3avisornet_windows32and64%3aes

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

Post to forums  

Rail Community


 

Autodesk Design & Make Report