|
POST
|
You can get the feature from the map's feature selection. The feature has a Class property that will tell you the feature class it comes from. You can then loop through all of the layers in the map until you find one that uses that feature class as a datasource. This is not foolproof as there can be any number of layers in the map that use the same feature class as a datasource. If this is the case then you will not be able to tell which layer the feature comes from.
... View more
12-02-2011
04:21 AM
|
0
|
0
|
1509
|
|
POST
|
Z values can be assigned in various ways. One way is to get each point and assign it a value. All polygons are a collection of points which can be accessed via IPointCollection. You loop through each point in the collection and assign the value. You can also assign z values using the methods on the IZ interface. If you want all points in the geometry to have the same z value then call SetConstantZ. If you have a functional surface (i.e. from an elevation model) you can call InterpolateFromSurface. The other methods such as MultiplyZs and OffsetZs require that z values already be present. One other thing I noticed in your code - you're specifying the circle to be counter-clockwise in your call to CreateCircle. A circle that is created CCW is considered a "hole" and will have a negative area. I don't know if this is what you want or not but thought I'd call it to your attention.
... View more
11-23-2011
06:25 AM
|
0
|
0
|
1496
|
|
POST
|
You're assigning a z value to a point, not the circle. The circle is never given z values in your code. Making the circle geometry z-aware doesn't give it z values, it simply makes it so you CAN give it z values. You still have to assign an appropriate z value to each point in the geometry. There are several ways to do this so you'll have to choose the way that best suits what you're wanting to do.
... View more
11-23-2011
05:25 AM
|
0
|
0
|
1496
|
|
POST
|
What you're asking about is how to "automate" Excel. That's too big a topic for a discussion thread but Microsoft has plenty of documentation on the subject if you care to read it. Basically what you will need to do is open Excel, load the document, plug your values into the appropriate cells and read the results from wherever the worksheet puts them. It would probably be easier, not to mention cleaner, to simply code the functions in VBA.
... View more
11-23-2011
04:37 AM
|
0
|
0
|
1312
|
|
POST
|
As the error says, you haven't assigned z values to the geometry. In order to save a feature into a z-aware feature class you must give each point in the geometry a z value.
... View more
11-23-2011
04:20 AM
|
0
|
0
|
1496
|
|
POST
|
The default selection color is accessed/set through ISelectionEnvironment. The selection symbology for individual layers can be accessed/set through IFeatureSelection.
... View more
11-22-2011
10:58 AM
|
0
|
0
|
526
|
|
POST
|
Dim pSegCol As ISegmentCollection Set pSegCol = New Ring pSegCol.AddSegment pConstrCArc Dim pGeoCol As IGeometryCollection Set pGeoCol = New Polygon pGeoCol.AddGeometry pConstrCArc As stated in the developer help, the geometry collection for a polygon is a collection of rings. You're trying to add a circular arc to the geometry collection, which is not a ring. If you want to create a polygon from the circular arc then all you need to do is create a new polygon object, QI to ISegmentCollection and add the circular arc. Dim polygon As IPolygon Set polygon = new Polygon Dim segmentCollection As ISegmentCollection Set segmentCollection = polygon segmentCollection.AddSegment circularArc Of course, your original code will work if you add the segment collection to the geometry collection instead of the circular arc.
... View more
11-22-2011
05:00 AM
|
0
|
0
|
1496
|
|
POST
|
Dim pConstCArc As IConstructCircularArc Set pConstCArc = New CircularArc pConstrCArc.ConstructCircle pPointBot, 5, True Error run-time 424: Object required You are declaring the variable as pConstCArc but trying to call it as pConstrCArc. Notice the "r"? I would recommend that you go into your VBA settings and check the option to require variable declaration.
... View more
11-22-2011
04:07 AM
|
0
|
0
|
1496
|
|
POST
|
You shouldn't be embedding interop types for your ESRI assembly references. However, this is indicative that you have targeted the .NET Framework 4.0 which is not currently supported by ESRI. If you change your project to reference the .NET Framework 3.5 then the error should go away.
... View more
11-17-2011
04:22 AM
|
0
|
0
|
1391
|
|
POST
|
public void DrawText( IActiveView view, string text, string fontName, int fontColor, float fontSize, IPoint point ) {
ITextSymbol textSymbol = new TextSymbol();
stdole.IFontDisp font = textSymbol.Font;
font.Name = fontName;
font.Size = (decimal)fontSize;
textSymbol.Font = font;
IColor color = textSymbol.Color;
color.RGB = fontColor;
textSymbol.Color = color;
ITextElement textElement = new TextElementClass();
textElement.Text = text;
textElement.Symbol = textSymbol;
textElement.ScaleText = true;
IElement element = textElement as IElement;
element.Geometry = point;
view.GraphicsContainer.AddElement( element, 0 );
view.PartialRefresh( esriViewDrawPhase.esriViewGraphics, element, null );
}
Can anyone suggest to me why this code always sets the font and size correctly but sometimes fails to set the color correctly? I always see the correct color in the 'textSymbol.Color' property after the line that sets it to 'color.' On the map (within a layer) it sometimes appears to 'combine' with that layer's fill color and off the map it sometimes appears 'blue.' Is this a bug? I am using ArcGIS 10, service pack 2. Is this on a 64-bit machine? I've seen problems on 64-bit machines where apparently the alpha bit was not being read correctly. I believe the solution was to set the transparency property on the color object to 1 instead of leaving it at the default of 0.
... View more
11-16-2011
08:42 AM
|
0
|
0
|
1896
|
|
POST
|
Make sure your geometry has z values. NaN is not a valid z value, the z value must be a number.
... View more
11-15-2011
04:39 AM
|
0
|
0
|
1168
|
|
POST
|
Is your feature class z-aware? If not, you can't store z values in it. You can check this by looking at the feature class properties in ArcCatalog - Has Z will be true if the feature class is z-aware.
... View more
11-14-2011
11:53 AM
|
0
|
0
|
1168
|
|
POST
|
Hi all I have a plugin install which I developed in .NET for ArcGIS 9.3.1 which works fine on XP machines and ArcGIS 10. \ Are you sure about that? ArcGIS 10 is not compatible with previous versions as there are no policy assemblies for the ArcObjects libraries to redirect your application to the newer assemblies. Applications developed under previous versions must be recompiled. Also, the way components are registered in the ESRI component categories has also changed. Prior to migrating our applications to ArcGIS 10 we tested them just to see if they would run. Not a single one of them would even install.
... View more
11-14-2011
05:19 AM
|
0
|
0
|
1702
|
|
POST
|
The spatial reference of a feature class is not related to whether or not it has M or Z values. M and Z values are part of the geometry definition for the class. To determine if a feature class is M or Z enabled, you need to get the geometry definition (IGeometryDef) from its Shape field and check the HasM and HasZ properties. Dim shapeFieldIndex As Int32 = featureClass.Fields.FindField(featureClass.ShapeFieldName) Dim shapeField As IField = featureClass.Fields.Field(shapeFieldIndex) Dim geometryDef As IGeometryDef = shapeField.GeometryDef Dim isMAware As Boolean = geometryDef.HasM Dim isZAware As Boolean = geometryDef.HasZ
... View more
11-09-2011
09:52 AM
|
0
|
0
|
950
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-20-2014 05:29 AM | |
| 1 | 02-01-2011 04:18 AM | |
| 1 | 02-04-2011 04:15 AM | |
| 1 | 01-17-2014 03:57 AM | |
| 1 | 10-07-2010 07:37 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|