POST
|
Thanks for this Than. This is a bug. 2.7 is almost final and so we cannot get the fix in for 2.7. We will fix this in 2.8
... View more
11-20-2020
10:45 AM
|
2
|
1
|
372
|
POST
|
Thanks for this Joel. This could be a bug then. Could you make a repro available to tech support so we can debug?
... View more
11-10-2020
08:05 AM
|
0
|
0
|
132
|
POST
|
The add-in must be loaded. (Step 10). The toolbox folder is not deployed on install. When Pro shuts down the folder remains. _However_, if: either - the add-in is uninstalled or - the add-in is not loaded the next time Pro starts (eg security settings were changed) the toolboxes folder will be deleted..... So even though the folder may be present on the disk between Pro sessions, if the accompanying add-in is not loaded for the session then neither will its toolbox. This is mentioned under the "Note:" at the bottom of the previously referenced article. I suspect the confusion is arising from examining the assembly cache location of a previously loaded add-in where the toolboxes folder would be present (if it had an embedded toolbox) and comparing it with the assembly cache location of an add-in with an embedded toolbox that has not (been loaded).
... View more
11-09-2020
09:55 AM
|
1
|
2
|
132
|
POST
|
Chris, you can only read collada from a file. Note from: SymbolFactory ConstructMarkerFromStream(...) Remarks: " Marker can be created from the following stream data type: JPG, BMP, PNG, GIF ". (I realize that the code example on the API reference page is a little misleading because it is actually using "ConstructMarkerFromFile".)
... View more
09-30-2020
04:15 PM
|
0
|
1
|
50
|
POST
|
David, in addition to Wolf's suggestion, please see the below event. The ProjectItemsChangedEventArgs will tell you what the change is (map added, removed, layout added, removed, etc,etc) via its Action and ProjectItem properties. ArcGIS.Desktop.Core.Events.ProjectItemsChangedEvent
... View more
07-27-2020
04:49 PM
|
0
|
0
|
69
|
POST
|
Simon, with the release of 2.6, (tomorrow, July 28th, PST) this event is now available: ArcGIS.Desktop.Core.Events.PortalSignOnChangedEvent
... View more
07-27-2020
04:33 PM
|
0
|
1
|
106
|
POST
|
Hi Curt, try this: The key is that the code attempts to eliminate any unnecessary selections either by checking the amount of movement of the mouse or by comparing the current mouse position with the polygon of the current parcel. Only if the mouse has moved the pre-requisite amount that would result in a new parcel being selected does the code actually do the selection... Note: one important assumption - that the map and parcel layer are in the _same_ projection...if they have different SRs then the "GeometryEngine.Instance.Intersects" statement will fail. The map point would have to be projected first and that could be an expensive operation. To ensure that they do have the same projection just change the Map CoordinateSystem to be the same as Parcels via the Map Properties dialog. internal class SelectOnMove1 : MapTool { private Point _lastLocation ; private FeatureLayer _parcelLayer = null ; private static readonly object _resultsLock = new object ( ) ; Dictionary < string , object > _currentResults = null ; private int _deltaPixels = 0 ; public SelectOnMove1 ( ) { IsSketchTool = true ; SketchType = SketchGeometryType . Rectangle ; SketchOutputMode = SketchOutputMode . Map ; } protected override Task OnToolActivateAsync ( bool active ) { _parcelLayer = MapView . Active . Map . GetLayersAsFlattenedList ( ) . FirstOrDefault ( l = > l . Name == "Parcels" ) as FeatureLayer ; if ( _deltaPixels == 0 ) _deltaPixels = SelectionEnvironment . SelectionTolerance ; return base . OnToolActivateAsync ( active ) ; } protected override Task OnToolDeactivateAsync ( bool hasMapViewChanged ) { _parcelLayer = null ; return base . OnToolDeactivateAsync ( hasMapViewChanged ) ; } protected async override void OnToolMouseMove ( MapViewMouseEventArgs e ) { if ( _parcelLayer == null ) return ; //use SelectionEnvironment.SelectionTolerance but change this as needed //....default is usually 3... if ( _lastLocation . X >= e . ClientPoint . X - _deltaPixels && _lastLocation . X <= e . ClientPoint . X + _deltaPixels && _lastLocation . Y >= e . ClientPoint . Y - _deltaPixels && _lastLocation . X <= e . ClientPoint . X + _deltaPixels ) return ; _lastLocation = e . ClientPoint ; //Get the feature attributes or null var pin = await QueuedTask . Run ( ( ) = > { //Make sure that the Map spatial reference is set to the //_same_ SR as the parcels layer! var mpt = MapView . Active . ClientToMap ( e . ClientPoint ) ; var strap = "" ; //check against the shape first - note: we are assuming that //the mpt and "poly" SRs are the same! if ( _currentResults != null ) { strap = ( string ) _currentResults [ "STRAP" ] ; //is the point in the current feature extent? var extent = _currentResults [ "ENVELOPE" ] as Envelope ; if ( mpt . X <= extent . XMax && mpt . X >= extent . XMin && mpt . Y <= extent . YMax && mpt . Y >= extent . YMin ) { //see if we are still selecting the same feature var poly = _currentResults [ "SHAPE" ] as Polygon ; if ( poly != null && GeometryEngine . Instance . Intersects ( poly , mpt ) ) return strap ; } } //This is for the selection + highlight var sqf = new SpatialQueryFilter ( ) { FilterGeometry = mpt , SpatialRelationship = SpatialRelationship . Intersects , SubFields = "OBJECTID" } ; //This is the slowest part... var sel = _parcelLayer . Select ( sqf ) ; if ( sel . GetCount ( ) == 0 ) return strap ; var oid = sel . GetObjectIDs ( ) . First ( ) ; if ( _currentResults != null ) { var curr_oid = ( long ) _currentResults [ "OBJECTID" ] ; if ( oid == curr_oid ) return strap ; } var attrib = Module1 . Current . GetParcelRecord ( _parcelLayer , oid ) ; _currentResults = attrib ; strap = ( string ) _currentResults [ "STRAP" ] ? ? "null" ; return strap ; } ) ; //Do something with the results... var info = $ "Current: STRAP:{pin}" ; //etc } protected override Task < bool > OnSketchCompleteAsync ( Geometry geometry ) { return base . OnSketchCompleteAsync ( geometry ) ; } } From the Module: internal class Module1 : Module { private static Module1 _this = null ; private Dictionary < long , Dictionary < string , object > > _cache = new Dictionary < long , Dictionary < string , object > > ( ) ; private bool _useCache = true ; /// <summary> /// Retrieve the singleton instance to this module here /// </summary> public static Module1 Current { get { return _this ? ? ( _this = ( Module1 ) FrameworkApplication . FindModule ( "DoMouseMove_Module" ) ) ; } } public Dictionary < string , object > GetParcelRecord ( BasicFeatureLayer parcels , long oid ) { if ( _useCache && _cache . ContainsKey ( oid ) ) { return _cache [ oid ] ; } var qf = new QueryFilter ( ) { SubFields = "SHAPE,STRAP" , ObjectIDs = new List < long > { oid } } ; var rc = parcels . Search ( qf ) ; rc . MoveNext ( ) ; var dict = new Dictionary < string , object > ( ) ; dict [ "OBJECTID" ] = oid ; dict [ "SHAPE" ] = rc . Current [ "SHAPE" ] as Geometry ; dict [ "ENVELOPE" ] = ( ( Geometry ) rc . Current [ "SHAPE" ] ) . Extent ; dict [ "STRAP" ] = rc . Current [ "STRAP" ] as string ? ? "null" ; rc . Dispose ( ) ; if ( _useCache ) { _cache [ oid ] = dict ; } return dict ; } #region Overrides /// <summary> /// Called by Framework when ArcGIS Pro is closing /// </summary> /// <returns>False to prevent Pro from closing, otherwise True</returns> protected override bool CanUnload ( ) { //TODO - add your business logic //return false to ~cancel~ Application close return true ; } #endregion Overrides } }
... View more
07-14-2020
04:49 PM
|
2
|
1
|
19
|
POST
|
Hi Alex, Look here... ProSnippets Geodatabase Obtaining List of Defintions from Geodatabase ProSnippets Geodatabase, Obtaining related definitions from geodatabase piecing the bits together gives you what you want //From the snippets... IReadOnlyList < FeatureDatasetDefinition > featureDatasetDefinitions = geodatabase . GetDefinitions < FeatureDatasetDefinition > ( ) ; bool electionRelatedFeatureDatasets = featureDatasetDefinitions . Any ( definition = > definition . GetName ( ) . Contains ( "Election" ) ) ; . . . and . . . FeatureDatasetDefinition featureDatasetDefinition = geodatabase . GetDefinition < FeatureDatasetDefinition > ( "LocalGovernment.GDB.Address" ) ; IReadOnlyList < Definition > datasetsInAddressDataset = geodatabase . GetRelatedDefinitions ( featureDatasetDefinition , DefinitionRelationshipType . DatasetInFeatureDataset ) ; //put it together and you get... IReadOnlyList < Definition > fdsList = gdb . GetDefinitions ( DatasetType . FeatureDataset ) ; //get all the feature classes... foreach ( var fdsDef in fdsList ) { var defsInDataset = gdb . GetRelatedDefinitions ( fdsDef , DefinitionRelationshipType . DatasetInFeatureDataset ) ; foreach ( var def in defsInDataset ) { //Or use LINQ .Where( d => d.DatasetType ... if ( def . DatasetType == DatasetType . FeatureClass ) . . . etc . . .
... View more
06-26-2020
09:41 AM
|
2
|
1
|
183
|
POST
|
Add the based on attribute to your style and you will be good to go. Is there some reason that does not work for you? <ComboBox.Style> < Style TargetType = " {x:Type ComboBox} " BasedOn = " {StaticResource {x:Type ComboBox}} " > .... </ Style > </ComboBox.Style>
... View more
05-26-2020
12:00 PM
|
2
|
1
|
402
|
POST
|
Hi Sreeni, apologies for the delay but we were testing this configuration. The bottom line is that the classes referred to in the DAML must be in the add-in assembly. Therefore, to distribute functionality across multiple assemblies, in general, there are two choices (and variations thereof): Spread the functionality across multiple add-ins.The "master" add-in, for example, defines the Tabs and the "optional" add-ins update the Tab(s) with their buttons and so forth. Within the add-in use a containment pattern to load the library classes/functions that do the "work" within the buttons, etc. public class AddinButton : . . . { private SomeLibraryClass _doRealWork = null ; protected override void OnClick ( ) { if ( _doRealWork == null ) { _doRealWork = new SomeLibraryClass ( . . . ) ; } //etc There is a third option that involves Categories but that is beyond the scope of this post. If you are interested in that please review these samples and watch this technical session: ConfigureGallery sample CustomCategories sample Advanced Pro UI Customization, Dev Summit 2019. Advance to 36:17.
... View more
04-28-2020
09:02 AM
|
0
|
1
|
25
|
Online Status |
Offline
|
Date Last Visited |
Thursday
|