If you copy a layer ilayer data to the 3D scenecontrol control (perform related operations)

Source: Internet
Author: User
Content summary
Copy Data in mapcontrol, data in an ilayer layer, or data in a selection set to the scenecontrol 3D control.
Process description

Dim pfeatureselection as ifeatureselection
Dim pspatialfilter as ispatialfilter
Dim pfeaturelayerdefinition as ifeaturelayerdefinition

Dim pfeaturelayermx as ifeaturelayer
Dim pfeaturelayersx as ifeaturelayer

Dim p3dproperties as i3dproperties

Dim pgeofeaturelayermx as igeofeaturelayer
Dim pgeofeaturelayersx as igeofeaturelayer

Dim playersx as ilayer
Dim pcolor as icolor
Dim psymbol as isymbol
Dim pobjectcopy as iobjectcopy 'esricontrolssupport. iobjectcopy
'
Dim plistitems as mscomctllib. listitems
Dim plistitem as mscomctllib. listitem

'------------------------------------------------------
'Select features that pass through the current extent
'------------------------------------------------------
Set playersx = nothing
If typeof playermx is ifeaturelayer then
Set pfeaturelayermx = playermx
If pfeaturelayermx. featureclass. featuretype = esriftsimple then
Set pspatialfilter = new spatialfilter
Set pspatialfilter. Geometry = menvelope
'
'Pspatialfilter. geometryfield = pfeaturelayermx. featureclass. shapefieldname
Pspatialfilter. spatialrel = esrispatialrelintersects
'
Set pfeatureselection = pfeaturelayermx
Call pfeatureselection. selectfeatures (pspatialfilter, esriselectionresultnew, false)
'
Set pfeaturelayerdefinition = pfeaturelayermx
Set pfeaturelayersx = pfeaturelayerdefinition. createselectionlayer (pfeaturelayermx. Name, true ,"","")
Pfeaturelayersx. Visible = pfeaturelayermx. Visible
'
Call pfeatureselection. Clear
'
Set pgeofeaturelayermx = pfeaturelayermx
Set pgeofeaturelayersx = pfeaturelayersx
Set pobjectcopy = new objectcopy
Set pgeofeaturelayersx. Renderer = pobjectcopy. Copy (pgeofeaturelayermx. Renderer)
'
Set playersx = pfeaturelayersx
End if
Else
If typeof playermx is irasterlayer then
Dim prasterlayermx as irasterlayer
Set prasterlayermx = playermx
Prasterlayermx. visibleextent = menvelope
Set playersx = prasterlayermx

End if
End if
'-----------------------
'Add layer to arcscene where mscenegraph is the control name
'-----------------------
Call mscenegraph. Scene. addlayer (playersx, false)

'---------------------------------
'Update 3D properties of sxlayer
'---------------------------------
Set p3dproperties = get3dpropertiesfromlayer (playersx)
If not (p3dproperties is nothing) then
'P3dproperties. baseexpressionstring = "0"
'P3dproperties. baseoption = esribaseshape
P3dproperties. depthpriorityvalue = ppriority
'P3dproperties. extrusionexpressionstring = ""
'P3dproperties. extrusiontype = esriextrusionnone
'P3dproperties. faceculling = esrifacecullingnone
'P3dproperties. Illuminate = true
'P3dproperties. offsetexpressionstring = "0"
'P3dproperties. rendermode = esrirendercache
'P3dproperties. renderrefreshrate = 0.75
'P3dproperties. rendervisibility = esrirenderalways
'P3dproperties. smoothshading = true
'P3dproperties. zfactor = 1
'
Call p3dproperties. apply3dproperties (playersx)
End if
'End if

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.