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: 

Creating Custom Subassemblies with VBA !!!

3 REPLIES 3
Reply
Message 1 of 4
Anonymous
383 Views, 3 Replies

Creating Custom Subassemblies with VBA !!!


 
3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: Anonymous

First you have create a "AeccTinCreationData Object":
Properties:
BaseLayer
Description
Layer
Name
Style
When you finish with this, you can create an "AeccTinSurface" with this sentence:

Set MyTSurf = Surfaces.AddTinSurface _
( AeccTinCreationDataObject)

Now you have a new VOID EMPTY NOTHING tin-surface 😉
but don't worry: you can use many methods:
MyTSurf.PointGroups.Add...
MyTSurf.BreakLines.AddStandardBreakLine...
...
And more

If you create an "AeccSurface" you haven´t possibilities to add points, contours... It´s better use "AeccTinSurface"

See the Civil 3D API help carefully. Sometimes this help is no clear, for example: when you add breaklines :
Public Function AddStandardBreakline( _
ByVal pBreaklineEntities As Variant, _
ByVal Description As String, _
ByVal MidOrdinateDistance As Double _
) As AeccSurfaceBreakline

pBreaklineEntities is a ¿Variant?. Actually it´s an array which elements are ObjectID (from Autocad valid Objects. An ObjectID it´s a Long data number), but the help file doesn´t specify this... Be patient

I´m from Spain and level english it´s no good. Sorry. See you
Message 3 of 4
Anonymous
in reply to: Anonymous

Sorry your question it´s about Subassemblies

Its no posible create Subassemblies directly. You have to use the command line.

Dim BasicL(1 To 10) As Double 'Will be a Polyline

BasicL(1) = 0: BasicL(2) = 0
BasicL(3) = 10: BasicL(4) = -0.07
BasicL(5) = 10: BasicL(6) = -0.22
BasicL(7) = 0: BasicL(8) = -0.15
BasicL(9) = 0: BasicL(10) = 0
'Now draw the polyline
ThisDrawing.ModelSpace.AddLightWeightPolyline BasicL
'Call "CreateSubFromPline" with command line
AeccDoc.SendCommand "AeccCreateSubFromPline (entlast)" & vbCrLf

'entlast give last object you created. It is a LISP order

It's like when you click in Corridor-Create Subassembly From PolyLine. And appers the dialog window too

Then you can take this subassembly from the Subassemblies colection, and modify. You must create a subassembly macro
that control your subassembly to create corridor with it... It´s no easy

I don't like. AutoDesk haven't do a good API. Be patient
Message 4 of 4
JoaoMM
in reply to: Anonymous

In land/civil i am able to define new templates with control point, Superelevation, transition points, etc. In Civil3d2006 exists a options to create subassembly from a polyline. In this option is not possible to define transition points/ superelevations parameters, etc and the sections don´t update dynamic.
I think with a tool that permit create my own subassembly like land/civil is useful. I would like to know if Autodesk will develop a template editor to creat subassembly without going through VBA codes??

Thanks

Joao



When AutoDesk have a good API??

Thanks, Joao

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

Post to forums  

Rail Community


 

Autodesk Design & Make Report