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: 

get offset target's autocad objectID from subassembly

1 REPLY 1
Reply
Message 1 of 2
wang890
498 Views, 1 Reply

get offset target's autocad objectID from subassembly

what i am trying to do is i have a joint polyline with different segmental thicknesses, 4 thicknesses total, each represent a different soil type and a different subassemblies has to be applied. i can divide regions in my corridor but the problem there are over 1000 segments on this polyline with different thickness (width).

 

so my thought is make a custom subassembly. and add this polyline as an offset target (polyline follows alignment). however i only need to extract the instantaneous "polyline width" at that corridor section. so i can apply the condition and then draw links, points, shapes. from that.

 

so is it possible to obtain the objectID of the polyline with corridor built in subs so then i can figure out how to get width no problem. done convert objectID to object with the autocad.net.

 

i looked around the only places that the target is related are (just giving an example. i will use some other name of course for the target):

 

1. get input

  oParamsDouble.Add("ShoulderWidth", ShoulderWidthDefatult)

 

2. calculate offset, which mentions the offsettarget object.

 

      

IfNot oShoulderWidthTarget IsNothingThen

               

Dim dOffsetToThisAlignment AsDouble

               

Dim dXOnTarget AsDouble

               

Dim dYOnTarget AsDouble

               

IfTrue = Utilities.CalcAlignmentOffsetToThisAlignment(oAlignmentId, corridorState.CurrentStation, oShoulderWidthTarget, Utilities.GetSide(vSide), dOffsetToThisAlignment, dXOnTarget, dYOnTarget) Then

               

Else

                   

Utilities.RecordWarning(corridorState, CorridorError.LogicalNameNotFound, "TargetHA", "ShoulderExtendAll")

                    dOffsetToThisAlignment = dFlip * vShoulderWidth + oOrigin.Offset

               

EndIf

               

If vSide = Utilities.Left Then

                    vShoulderWidth = oOrigin.Offset - dOffsetToThisAlignment

                   

' Judge whether or not the left alignment is left to the base alignment

                   

If dOffsetToThisAlignment > oOrigin.Offset Then

                       

Utilities.RecordError(corridorState, CorridorError.ValueInABadPosition, "LeftMedianWidth", "ShoulderExtendAll")

                       

Exit Sub

                   

EndIf

               

Else

                    vShoulderWidth = dOffsetToThisAlignment - oOrigin.Offset

                   

' Judge whether or not the right alignment is right to the base alignment

                   

If dOffsetToThisAlignment < oOrigin.Offset Then

                       

Utilities.RecordError(corridorState, CorridorError.ValueInABadPosition, "RightMedianWidth", "ShoulderExtendAll")

                       

Exit Sub

                   

EndIf

               

EndIf

 

another way is make a program to divide regions and maybe even associate the corresponding subassemblies. i have never done this before and not sure can be done. but then to get the station start and end for each region i need to make another program to read the polyline then compare to alignment and get the station where the thickness changes. also will take a lot of time to make. besides 2 out of 4 conditions right now i can't use any stock subassembly ot do.

 

  

using visual basic 2010 express, civil 3d 2012.

 

this is gonna  be one interesting subassembly.

 

anyways just putting it here to see anybody have any idea. i will be working on this next week and looks like it's gonna take a while to do. i always get these super complicated stuff to do on top of other work.

Stantec
Dell Precision 5530, Prism M320PU, C3D 14/17/19
1 REPLY 1
Message 2 of 2
wang890
in reply to: wang890

lol.

 

right i hit ok then i found that the "targetID" is the objectID.

 

it's the only property in widthoffsettarget, duh

 

x (

 

now off to the autocad group to find out how do you get the instantanous polyline width, by having the station NE point projected to the polyline.

 

i guess i can just select all the polylines (keeping them seperated), then i think civil 3d can pinpoint down the only one that falls at that station. doesn't it? then good to go. doesn't look like it goes through all the targets selected for each station

 

looks like the

 

   oShoulderWidthTarget = oParamsOffsetTarget.Value(

"TargetHA")

 

already done the filtering?

Stantec
Dell Precision 5530, Prism M320PU, C3D 14/17/19

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

Post to forums  

Rail Community


 

Autodesk Design & Make Report