POST
|
Hi, I am quite new to City Engine CGA rules. I am trying to understand the offset and split rules. I am using this simple script from the help file attr red = "#FF0000" attr green = "#008000" attr offsetval = -5 attr extrudeval = 20 Lot --> offset(offsetval) A A --> comp(f) { inside: I | border: O } I --> color(red) #I --> extrude(extrudeval) O --> color(green) My original lot shape is a rectangle. Please see attached image.[ATTACH=CONFIG]22866[/ATTACH] Basically I don't want equal offset on all 4 sides. I want to control the amount of offset on each side and also treat each of that side with a different attribute. For eg. Front --> color (blue) offset (-4) Back -- > color(red) offset (-1) Left } and so on... Right Any help is much appreciated. Thanks & Regards, Priyanka
... View more
03-21-2013
07:51 PM
|
0
|
9
|
3028
|
POST
|
http://forums.esri.com/Thread.asp?c=93&f=993&t=176065&mc=2#msgid518770 Regards, Priyanka
... View more
03-01-2012
06:31 PM
|
0
|
0
|
256
|
POST
|
Hi, Here is a VB code for it. You will have to write it on load event.
Private Sub Tool_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
''''' Populates layer combo box. Iterates through TOC and populates the combo box with available layers
On Error GoTo EH
Dim pMxDoc As IMxDocument
Dim pMap As IMap
pMxDoc = My.ArcMap.Application.Document
pMap = pMxDoc.FocusMap
Dim pLayer As ILayer
Dim i As Integer
If pMap.LayerCount = 0 Then
Exit Sub
End If
For i = 0 To pMap.LayerCount - 1
pLayer = pMap.Layer(i)
cmbLayer.Items.Add(pMap.Layer(i).Name)
Next i
Exit Sub
EH:
Debug.Print(Err.Number & " " & Err.Description)
End Sub
Please try searching for solution on forums and ESRI help documents before posting a thread. You will find most of your problems are already asked and resolved. Below is the link to archived forum http://forums.esri.com/Search.asp?c=93 Its very useful especially in the beginning stage. Hope it helps ! Regards, Priyanka
... View more
03-01-2012
06:14 PM
|
0
|
0
|
540
|
POST
|
Hi, I am not too sure of what problem you are exactly facing, but I guess this might help. This code joins layer to layer
Dim pFeatLayer As IFeatureLayer
Dim pFeatLayerjn As IFeatureLayer
Dim pDispTable As IDisplayTable
Dim pFCLayer As IFeatureClass
Dim pTLayer As ITable
Dim pActiveView As IActiveView
pMxDoc = My.ArcMap.Document
pMap = pMxDoc.FocusMap
pActiveView = pMap
pMap.ClearSelection()
pActiveView.Refresh()
Dim pTLayer2 As ITable
If pMap.LayerCount < 2 Then
MsgBox("Must have at least two layer", MsgBoxStyle.Information)
Exit Function
End If
''''''''''''''''*****************************''''''''''''''''''''''''''
pFeatLayerjn = FindLayerByName(pMap, LayerName)
If pFeatLayerjn Is Nothing Then
MsgBox("Could not find Layer " & LayerName & "for joining", MsgBoxStyle.Exclamation)
Exit Function
End If
pDispTable = pFeatLayerjn
pFCLayer = pDispTable.DisplayTable
pTLayer = pFCLayer
pFeatLayer = pMap.Layer(0)
pDispTable = pFeatLayer
pFCLayer = pDispTable.DisplayTable
pTLayer2 = pFCLayer
Dim strJnField As String
Dim JnField2 As String
strJnField = joinfield1 ''''''' FID
JnField2 = joinfield2 ''''''' PntName
' Create virtual relate
Dim pMemRelFact As IMemoryRelationshipClassFactory
Dim pRelClass As IRelationshipClass
pMemRelFact = New MemoryRelationshipClassFactory
pRelClass = pMemRelFact.Open("LayertoLayer", pTLayer2, strJnField, pTLayer, JnField2, "forward", "backward", esriRelCardinality.esriRelCardinalityOneToOne)
' use Relate to perform a join
Dim pDispRC As IDisplayRelationshipClass
pDispRC = pFeatLayer
pDispRC.DisplayRelationshipClass(pRelClass, esriJoinType.esriLeftOuterJoin)
MsgBox("Fields Joined", MsgBoxStyle.Information)
Referring this one might also help http://forums.esri.com/Thread.asp?c=93&f=992&t=97996&mc=3#msgid274992 Regards, Priyanka
... View more
03-01-2012
05:41 PM
|
0
|
0
|
216
|
POST
|
Hi, Are you by any chance decreasing the resolution of your raster i.e. increasing the pixel size from original. I tired the code on a raster with a pixel size of 5 originally. If I resample it with cell size 7 I will definitely loose information. Even the size of the raster on hard disk will decrease. On the other hand, if I change the size to 2, then I obviously wont loose any information and there are no round offs. Moreover, in your case, since your pixels are not square originally, that might also be a reason for lost information somewhere. Try the same code on a standard raster and see if there is any difference. Does it work fine when you do it manually by using 'Data' --> 'Export Data'.
... View more
02-29-2012
10:16 PM
|
0
|
0
|
859
|
POST
|
Hi, I guess this should work. You can exclude killifexistsraster function if you want, because it deletes the output raster without warning when you try it again. Dim pMxDoc As IMxDocument
Dim pMap As IMap
Dim pRasterLayer As IRasterLayer
Dim pRaster As IRaster
Dim pGeometryProc As IRasterGeometryProc
pMxDoc = My.ArcMap.Application.Document
pMap = pMxDoc.FocusMap
pRasterLayer = pMap.Layer(0)
pRaster = pRasterLayer.Raster
pGeometryProc = New RasterGeometryProc
pGeometryProc.Resample(rstResamplingTypes.RSP_NearestNeighbor, 7, pRaster)
Dim pDataset As IDataset
pDataset = pRasterLayer
Dim pWS As IWorkspace
pWS = pDataset.Workspace
Dim str As String
str = pWS.PathName
killifexistsRaster("try", str)
Dim RasterDataset As IRasterDataset
Dim pRasBandCol As IRasterBandCollection
pRasBandCol = pRaster
'pDS = pRasBandCol.SaveAs("try3", pWS, "GRID")
RasterDataset = pRasBandCol.SaveAs("try", pWS, "GRID")
'***********************************
Dim pRasterLy As IRasterLayer
pRasterLy = New RasterLayer
' pRasterLayer.CreateFromRaster(pRaster)
pRasterLy.CreateFromDataset(RasterDataset)
pMap.AddLayer(pRasterLy)
pMxDoc.ActiveView.Refresh()
'***********************************
SaveAsWithoutBuildingPyramids(pRaster)
End Sub
Sub SaveAsWithoutBuildingPyramids(ByVal pRaster As IRaster) 'Or as IRasterDataset)
killifexistsRaster("tryexp", "C:\temp")
Dim pSaveAs2 As ISaveAs2
pSaveAs2 = pRaster
Dim pStorageDef As IRasterStorageDef2
pStorageDef = New RasterStorageDef
pStorageDef.PyramidLevel = 0
Dim pWs As IWorkspace
pWs = SetRasterWorkspace("c:\temp")
pSaveAs2.SaveAs("try_exp", pWs, "GRID")
End Sub
Public Function SetRasterWorkspace(ByVal sPath As String) As IRasterWorkspace
Dim pWsFact As IWorkspaceFactory
pWsFact = New RasterWorkspaceFactory
SetRasterWorkspace = pWsFact.OpenFromFile(sPath, 0)
End Function
Public Function killifexistsRaster(ByVal RasterName As String, ByVal strFolder As String)
'''''' Delete raster from disk
Dim pRWSF As IWorkspaceFactory
pRWSF = New RasterWorkspaceFactory
Dim pRWS As IRasterWorkspace
pRWS = pRWSF.OpenFromFile(strFolder, 0)
Dim pRasterDS As IRasterDataset
On Error Resume Next
pRasterDS = pRWS.OpenRasterDataset(RasterName)
If Not pRasterDS Is Nothing Then
Dim pDS As IDataset
pDS = pRasterDS
If pDS.CanDelete Then pDS.Delete()
End If
System.IO.Directory.Delete(strFolder & "\" & RasterName, True)
DeleteFolder(strFolder & "\" & RasterName)
End Function
Public Function DeleteFolder(ByVal strPath As String) As Boolean
Dim objDir As New IO.DirectoryInfo(strPath)
Try
objDir.Delete(True)
Return True
Catch
Return False
End Try
End Function
... View more
02-27-2012
07:54 PM
|
0
|
0
|
859
|
POST
|
So now what I understand is, that you are being able to standardize it in terms of pixel size but it becomes an 8 bit raster because it keeps forcing the renderer. Do you want to share your code developed till now .. may b we can catch something
... View more
02-23-2012
10:49 PM
|
0
|
0
|
859
|
POST
|
What exactly are you attempting to explain when you say 'non standard raster' ? If you want to change the pixel width, have you tried resampling(because your final raster has x=y cellsize) before exporting. Regards, Priyanka
... View more
02-23-2012
08:59 PM
|
0
|
0
|
859
|
POST
|
Hi Neil, Thanks for the reply. I still have some doubts. Create a tool that allows the user to click the map. Earlier I was using 9.3 there I used to create a UI Tool control for such purposes. Now that I am using version 10, I am not really being able to find / create a tool that would allow the user to click the map !! So basically, the main problem I am facing is "clicking on screen/map" since I cant find UI Tool control or something similar to that in version 10. Regards, Priyanka
... View more
02-20-2012
04:11 PM
|
0
|
0
|
215
|
POST
|
Hi all, I have a add in where a button calls a form which has various buttons and work through onClick event. I want to create one more button on this form that can create a point by clicking mouse button on screen and also retrieve its XY coordinate Thanks in advance, Priyanka
... View more
02-20-2012
01:37 AM
|
0
|
3
|
483
|
POST
|
Hi all, Is there a way to call Merge command from ArcMap Id. I am unable to find it. when I search through keyword 'merge' from this document I can't find the one that I want http://edndoc.esri.com/arcobjects/8.3/TechnicalDocuments/ArcMapIds.htm I just want to call Merge tool (found in Data Management) Is it possible. Can somebody help me with ArcMap Ids.. Thanks Priyanka
... View more
08-01-2011
08:43 PM
|
0
|
1
|
386
|
POST
|
Thanks a lot Sandhya! The codes I was trying available from the old forums were running but were too slow. I found this tool http://code.google.com/p/typeconvert/ which also has 'remove duplicates' and runs pretty fast and also creates 2 shapefiles : (1) With no duplicate polylines (2) the duplicate polylines that were deleted So now I use (2) to spatially locate and select polylines exactly overlapping (1) .. export these selected polylines . Join fields and do the calculation.. seems to be a bit of round about but is working for me for now.. Any suggestions to make it a simpler process are most welcome thanks and regards, Priyanka
... View more
06-02-2011
11:41 PM
|
0
|
0
|
258
|
POST
|
Hi all, This one is slightly challenging ! .. I have some building polygons. I have converted them to polylines. Wherever the polygons shared a boundary there i have two polylines now with different height attribute. They are actually nothing but adjacent walls of a building which differ in height. I want to calculate the difference between these two. So basically, I want to identify all places which have duplicate polylines and then I should be able to find out the difference in their height attribute field. Any ideas would be much appreciated.. Thanks and Regards, Priyanka
... View more
06-02-2011
12:34 AM
|
0
|
2
|
876
|
POST
|
Thanks a lot again Brian, The code looks neat to me. I am yet to test it though.. The reason I want to do it to determine the sky view factor. It is a value that determines how much sky is obstructed. The raster pixel values are nothing but the height of the buildings. If i am standing in the midst of tall buildings the amount of sky i would see is the sky view factor. The first tallest building that comes in my sight is the one that would be taken into consideration (Reason for the first maximum pixel) If there are consecutive pixels of the same elevation, then they might just be the breadth of that building It is calculated by a formula and the output from above code is one of the input of the formula. It is an interesting thing to study. Usually done for temperature modeling Thanks again, Priyanka
... View more
05-30-2011
07:37 PM
|
0
|
0
|
727
|
POST
|
Found one nice VBA code. http://forums.esri.com/Thread.asp?c=93&f=987&t=172882&mc=6#msgid508922 Thanks, Priyanka
... View more
05-12-2011
10:41 PM
|
0
|
0
|
153
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|