Mixing COM and .NET

Mixing COM and .NET

GTVic
Advisor Advisor
1,654 Views
8 Replies
Message 1 of 9

Mixing COM and .NET

GTVic
Advisor
Advisor

I am writing a program that creates the following:

 

  1. Point Styles (.NET)
  2. Point Descriptions Keys (COM)
  3. Marker Style for Survey Figure (COM)
  4. Survey Figure Style (COM)
  5. Survey Figure Prefix Database (COM)

If you are in the midst of a Transaction block to create a point style, is there any issue with using the COM interface to also create a Marker style? Or is it better to use the COM objects outside of the Transaction.

 

There seems to be a lot of stuff here that can only be done with COM, is that just work in progress with Autodesk?

 

For a Survey Figure Style there seems to be no way to set the following in code:

 

  1. Beginning Vertex Marker > Marker Style (Profile mode)
  2. Internal Vertex Markers > Marker Style (Profile mode)
  3. Ending Vertex Marker > Marker Style (Profile mode)
  4. Crossing Marker > Marker Style (Section mode)

You can read these values (e.g. FigureStyle.MidpointMarkersDisplayStyleProfile) but those properties are read-only.

 

I just want to make sure my assumptions about what you can do in COM vs. .NET are correct.

 

Thanks

 

 

0 Likes
Accepted solutions (1)
1,655 Views
8 Replies
Replies (8)
Message 2 of 9

Anonymous
Not applicable
Accepted solution

I have not personally ran into a problem running a COM create style in the middle of a transaction. I do choose to create a completely different project and keep COM separate from managed .Net but that is just personal housekeeping.

 

As regards the marker styles, the SurveyFigureStyle object only provides an ObjectId to the marker style. However, ALL are available.

 

Profile > Beginning Vertex Marker > Marker Style  = BeginningVertexMarkerStyleId

Profile > Internal Vertex Markers > Marker Style = InternalVertexMarkerStyleId 

Profile > Ending Vertex Marker > Marker Style = EndingVertexMarkerStyleId

Profile > Crossing Marker > Marker Style = CrossingMarkerStyleId

 

The MidpointMarkersDisplayStyleProfile is for the display settings of the different sub-components. Is this what you are looking for?

 

HTH

0 Likes
Message 3 of 9

GTVic
Advisor
Advisor

See image below, this is what I was looking for. I corrected a one thing since I first posted this.

 

213iDC0297671CC313CE

 

I mispoke referring to MidPointMarkersDisplayProfile, that is related to display settings as you said and I already have those set up properly, I think. The problem is the names don't match (VertexMarkersDisplayStyleProfile for Beginning Vertex Marker, MidpointMarkersDisplayStyleProfile for Internal Vertex Marker and EndpointMarkersDisplayStyleProfile for Ending Vertex Marker).

 

215i2F214920016E282F

 

 

 

With oFigureStyle
    With .FigureLinesDisplayStyleProfile
        .Visible = True
        .Layer = sKeyAtts(3)
        .Color = 256
        .Linetype = "ByLayer"
        .LinetypeScale = 1.0
        .Lineweight = 256
        .PlotStyle = "ByLayer"
    End With
    With .VertexMarkersDisplayStyleProfile
        .Visible = True
        .Layer = sKeyAtts(3)
        .Color = 256
        .Linetype = "ByLayer"
        .LinetypeScale = 1.0
        .Lineweight = 256
        .PlotStyle = "ByLayer"
    End With
    With .MidpointMarkersDisplayStyleProfile
        .Visible = True
        .Layer = sKeyAtts(3)
        .Color = 256
        .Linetype = "ByLayer"
        .LinetypeScale = 1.0
        .Lineweight = 256
        .PlotStyle = "ByLayer"
    End With
    With .EndpointMarkersDisplayStyleProfile
        .Visible = True
        .Layer = sKeyAtts(3)
        .Color = 256
        .Linetype = "ByLayer"
        .LinetypeScale = 1.0
        .Lineweight = 256
        .PlotStyle = "ByLayer"
    End With
End With

I was not able to find AeccSurveyFigureStyle.InternalVertexMarkerStyleId. Where did you find that property?

 

Thanks

 

 

0 Likes
Message 4 of 9

Anonymous
Not applicable

I did not follow Rule #1 - Always read in full OP comments.

 

What I posted is all from the .Net API and NOT com. Sorry about that. I just don't deal with COM anymore unless I absolutely have to so can't help you much on the COM side.

0 Likes
Message 5 of 9

GTVic
Advisor
Advisor

Ok, I was unable to find SurveyFigureStyle at all under .NET, can you give me a head start on where to find those properties in the maze? 🙂

0 Likes
Message 6 of 9

Anonymous
Not applicable

SURE! Assuming that you have referenced that AeccDbMgd and AecBaseMgd dll, the Survey figure style object is located at:

Autodesk.Civil.Survey.DatabaseServices.Styles.SurveyFigureStyle

 

Don't forget about object browser. Oftentimes when I am looking for something, I will do a quick search there.

 

HTH

0 Likes
Message 7 of 9

GTVic
Advisor
Advisor

Thanks, I was searching in the .NET API reference CHM file but got nothing. Maybe I'll be able to find the other items in .NET as well.

0 Likes
Message 8 of 9

Jeff_M
Consultant
Consultant

...deleted..... Ok, maybe not....back to looking.

Jeff_M, also a frequent Swamper
EESignature
0 Likes
Message 9 of 9

GTVic
Advisor
Advisor

After searching through the object browser I can create #3/#4 with .NET also.


  1. Point Styles (.NET)
  2. Point Description Key Set (Point Description Keys) (COM)
  3. Marker Style for Survey Figure (.NET)
  4. Survey Figure Style (.NET)
  5. Survey Figure Prefix Database (COM)

So I guess I'm stuck with COM for #2 and #5

0 Likes