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: 

Which default value for var type AlignmentSubEntity ?

6 REPLIES 6
Reply
Message 1 of 7
joantopo
421 Views, 6 Replies

Which default value for var type AlignmentSubEntity ?

I´m using C# and I must put a value for a new declared var.

 

If I have:

 

AlignmentSubEntity alignSubEnt;

 

which value do I put?

 

AlignmentSubEntity alignSubEnt = ..........  ;

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
6 REPLIES 6
Message 2 of 7
joantopo
in reply to: joantopo

I´m trying to do this:

http://adndevblog.typepad.com/infrastructure/2012/05/list-all-alignment-entities.html

 

But in C# doesn´t recognize "alignSubEnt".

 

How would it be this block in C#? 

Dim subEntCount As Integer = alignEnt.SubEntityCount
          For i As Integer = 0 To subEntCount - 1 'for each subentity
            'get the type
            Dim alignSubEnt As AlignmentSubEntity = alignEnt(i)
            Select Case alignSubEnt.SubEntityType
              Case AlignmentSubEntityType.Arc
                'ARC
                Dim alignSubEntArc As AlignmentSubEntityArc = _
                  alignSubEnt
              Case AlignmentSubEntityType.Line
                'LINE
                Dim alignSubEntLine As AlignmentSubEntityLine = _
                  alignSubEnt
              Case AlignmentSubEntityType.Spiral
                'SPIRAL
                Dim alignSubEntSpiral As AlignmentSubEntitySpiral = _
                  alignSubEnt
            End Select
Next

 

 

 

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
Message 3 of 7
Jeff_M
in reply to: joantopo

coded on the fly, but should be close.
int subentcount = alignEnt.SubEntityCount;
for (int i = 0; subentcount - 1; i++)
{
  AlignmentSubEntity alignSubEnt = (AlignmentSubEntity)alignEnt[i];
  switch (alignSubEnt.SubEntityType)
  {
    case AlignmentSubEntityType.Arc:
      //do whatever with the arc subent
      break;
    case AlignmentSubEntityType.Line:
      //do whatever with the line subent
      break;
    case AlignmentSubEntityType.Spiral:
      //do whatever with the spiral subent
      break;
  }
}

 

Jeff_M, also a frequent Swamper
EESignature
Message 4 of 7
joantopo
in reply to: Jeff_M

Great!!

All right.

 

Thannnnnnk you.

 

I didn´t understand this line: 

AlignmentSubEntity alignSubEnt = (AlignmentSubEntity)alignEnt[i];
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
Message 5 of 7
joantopo
in reply to: joantopo

Sorry.

 

Could you say me what default value for var "linea"?

                                switch (alignSubEnt.SubEntityType)
                                {

                                    case AlignmentSubEntityType.Line:
                                        //LINE

                                     AlignmentSubEntityLine linea ;

                                        subEntidad.Direction = linea.Direction; //acimut
                                        
                                        break;  

 I am using a list with properties (class subEntidad)

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
Message 6 of 7
joantopo
in reply to: joantopo

Maybe this...

 

AlignmentSubEntityLine linea = (AlignmentSubEntityLine)alignSubEnt ;

 

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
Message 7 of 7
Jeff_M
in reply to: joantopo

Yes, that should work. Then get the Direction from linea.

Jeff_M, also a frequent Swamper
EESignature

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

Post to forums  

Rail Community


 

Autodesk Design & Make Report