SARAN The design of spatial based decision support model in crude palm oil industry development
Bang-Jensen, J. and G. Gutin 2000. The Bellman-Ford-Moore algorithm. Digraphs: Theory, Algorithms and Applications. London, Springer-Verlag.
Banks, J., J. S. C. II, et al. 2010. Discrete -Event System Simulation, Pearson Education.
BapedaKutim 2011. Kutei Timur dalam Angka. Kutei Timur, Badan Perencanaan Pembangunan Daerah dan Badan Pusat Statistik Kutei Timur.
Basdabella, S. 2001. Pengembangan Sistem Agroindustri Kelapa Sawit dengan Pola Perusahaan Industri Rakyat. Teknologi Industri Pertanian. Bogor,
IPB. S3.
Beenhakker, H. L. 2010. Issues in Agricultural Marketing Strategy. Transportation Issues Series No. TRP7. New York, World Bank.
Benoit, D. and G. P. Clarke 1997. Assessing GIS for retail location planning.
Journal of Retailing and Consumer Services 44: 239-258.
Berman, O. and R. R. Mandowsky 1996. Location-allocation on congested
networks. European Journal of Operational Research 262: 238-250.
Berry, B. J. L. 1964. Approaches to Regional Analysis: A Synthesis. Annals
of the Association of American Geographers 541: 2-11.
Bhatnagar, R. and C.-C. Teo 2009. Role of logistics in enhancing competitive advantage A value chain framework for global supply chains.
International Journal of Physical Distribution Logistics Management 39
3: 202-226. Boroushaki, S. and J. Malczewski 2008. Implementing an extension of the
analytical hierarchy process using ordered weighted averaging operators with fuzzy quantifiers in ArcGIS. Computers Geosciences 34: 399-
410.
BPS 2005. Volume dan Nilai Ekspor Indonesia Komoditi Crude Palm Oil CPO tahun 1980-2005., Badan Pusat Statistik.
BPS 2011. Panjang Jalan Menurut Kondisi Jalan, Badan Pusat Statistik Kabupaten Kutei Timur.
BPS 2011. Statistik Daerah Kabupaten Kutei Timur 2011, Badan Pusat Statistik Daerah Kutei Timur.
BPS 2012. Sumbangan Beberapa Komoditas yang Dominan Terhadap Inflasi Nasional Selama Tahun 2010 dan 2011. Berita Resmi Statistik, Badan
Pusat Statistik. 1: 13.
Branas, C. C., E. J. MacKenzie, et al. 2000. A trauma resource allocation model for ambulances and hospitals. International Journal of Geographical
Information Systems 4: 3-20.
Brealey, R. A. and S. C. Myers 2002. Principles of Corporate Finance, Mcgraw Hill Higher Education.
Brown, J. G. and D. Touche 1994. Agroindustrial Investment and Operations. Washington, D.C., The World Bank.
Bruce A.Blonigen, W. W. W. 2006. International Trade, transportation networks and Port Choice. University of Oregon and Institute for Water
Resource, Department of Economics, University of Oregon, Eugene. Capitine, B. L. 2010. Development of Clusters and the Supply Chain
Management of Palm Oil Industry in Mozambique. Investment Promotion Economic Development. UK, Edinburg Napier University. Master.
Cassettari, S. 1993. Introduction to integrated geo-information management, Springer.
Chankong, V. and Y. Y. Haimes 1983. Multiobjective Decision Making Theory and Methodology. New York, North-Holland.
Chapman, K. 2009. Industrial Location, Elsevier. Church, R. L. 2002. Geographical Information System and Location Science.
Computers Operations Research 29: 541-562.
Church, R. L. and M. E. Meadows 1979. Location Modeling Utilizing
Maximum Service Distance Criteria. Geographical Analysis 11: 358-373.
Church, R. L. and A. T. Murray 2008. Business Site Selection, Location Analysis and GIS. New York, John Wiley.
Church, R. L. and C. ReVelle 1974. The Maximal Covering Location Problem. Conference on Regional Science Association.
Cowen, D. J. 1988. GIS versus CAD versus DBMS: What are the Difference.
Photogrammetric Engineering and Remote Sensing 54: 151-154.
Crainic, T. G. and G. Laporte 1997. Planning Models for Freight Transportation. European Journal of Operational Research: 409-438.
Daskin, M. S. 2008. What You Should Know About Location Modeling.
Naval Research Logistics 55: 283
–294. Deperin 2007. Gambaran sekilas industri minyak kelapa sawit. Jakarta,
Departemen Perindustrian RI. Deperin 2011. Pohon Industri Sawit. Retrieved 12 Desember 2011, from
http:agro.kemenperin.go.id406-POHON-INDUSTRI-KELAP-A- SAWIT
. Derekenaris, G., J. Garofalakis, et al. 2001. Integrating GIS, GPS and GSM
technologies for the effective management of ambulances. Computers, Environment and Urban Systems25: 267-278.
Dhingra, T., T. Singh, et al. 2009. Location strategy for competitiveness of special economic zones. Competitiveness Review: An International
Business Journal 194: 272-289.
Dijkstra, E. W. 1959. A Note on Two Problems in Connexion with Graphs.
Numerische Mathematik 1: 269 - 271.
Ditjenbun 2010. Luas Areal Dan Produksi Perkebunan Seluruh Indonesia Menurut Pengusahaan, Direktorat Jenderal Perkebunan, Departemen
Pertanian RI.
Djamaran, I. 2007. Pengembangan Agroindustri, TIP IPB. Dramowicz, E. 2005. Retail Trade Area Analysis Using the Huff Model. from
http:www.directionsmag.comarticlesretail-trade-area-analysis-using- the-huff-model123411
. Drezner, Z. and H. W. Hamacher 2004. Facility Location: Applications and
Theory, Springer. Eddie, W. L., Cheng, et al. 2007. A GIS approach to shopping mall location
selection. Building and Environment 422.
Edser, C. 2010. Growth in Malaysian Indonesian palm oil production.
Focus on Surfactants 20104: 2.
Eriyatno 2012. Ilmu Sistem: Meningkatkan Mutu dan Efektivitas Manajemen. Surabaya, Guna Widya.
Evans, J. R. and D. L. Olson 2005. Introduction to Simulation and Risk Analysis. New York, Pearson.
Figueroa, R. and M. Kartusch 2000. laming to the scene: Routing and Locating
to get there faster. Geospatial Today 10: 32-37.
Fine, C. H., R. Vardan, et al. 2002. Rapid-Response Capability in Value-Chain
Design. Sloan Management Review 432: 69-75.
Fitch, J. 2005. Response Times: Myths, Measurement and Management. Journal of Emergency Medical Services
http:www.jems.comjems23- 913246
. Fujita, M. 2012. Thünen and the New Economic Geography. Regional Science
and Urban Economics: 1-6.
GAPKI 2011. 7 Hambatan Industri Sawit. Info Sawit 52: 36.
Gar-On, A., Yeh, et al. 1996. An Integrated GIS and Location-Allocation Approach to Public Facilities Planning - An Example of Open Space
Planning. Computer, Environment and Urban Systems 2045: 339-350.
Geofrion, A. 1978. A guide to computer assisted methods for distribution
system planning. Sloan Management Review 245: 535-544.
Ghosh, A., S. McLafferty, et al. 1995. Multifacility Retail Networks. Facility Location: A Survey of Applications and Methods. Z. Drezner. New York,
Springer. Gingold, B., M. McLeish, et al. 2011. Moratorium Indonesia: Kesempatan bagi
Hutan dan Industri, World Resources Institute. Goenadi, D. H. 2005. Prospek Dan Arah Pengembangan Agribisnis Kelapa
Sawit Di Indonesia, Badan Penelitian Dan Pengembangan Pertanian, Departemen Pertanian.
Golberg, R., A. Ray, et al. 1974. Agribusiness Management for Developing Countries--Latin America. Cambridge, Mass, Ballinger Publishing
Company.
Goodchild, M. F. 1987. A spatial analytical perspective on geographical information systems. International Journal of Geographical Information
Systems 1: 327
–344. Goodchild, M. F. 2009. Geographic information systems and science: today
and tomorrow. Procedia Earth and Planetary Science 1: 1037
–1043. Gorter, C. and P. Nijkamp 2001. Location Theory. International Encyclopedia
of the Social Behavioral Sciences: 9013-9019. Greenhut, M. L., C.-C. Mai, et al. 1986. Impacts on optimum location of
different pricing strategies, market structures and customer distributions over space. Regional Science and Urban Economics 163.
Gunarta, I. K. 2006. Analisis Risiko Fluktuasi Pertumbuhan Demand pada Investasi Penambahan Kapasitas Pabrik Semen dengan Menggunakan
Simulasi. Seminar Techno SIM 2006, Yogyakarta, Fakultas Teknik Universitas Gajah Mada.
Hadi, S. 2011. Pembuatan Aplikasi Web Gis Untuk Informasi Pangsa Pasar Agrobisnis Dengan Alovmap Studi Kasus: Di Kabupaten Nganjuk,
Provinsi Jawa Timur. Jurusan Sistem Informasi, FTIF. Surabaya, ITS. Hagadone, T. A. and R. K. Grala 2012. Business Clusters in Mississipis Forest
Products Industry. Forest Policy and Economics 20: 16--24.
Hakimi, S. L. 1964. Optimum Locations of Switching Centers and the Absolute
Centers and Medians of a Graph. Operations Research 12: 450-459.
Hambali, E. 2005. Pengembangan Klaster Industrl Turunan Minyak Kelapa Sawit. Seminar Nasionat Pemanfaatan Oleokirrria BerbasIs Minyak Sawlt
pada Berbagai lndustri. Bogor. Harrington, J. and K. Tumay 2000. Simulation Modelling Methods to Reduce
Risks and Increase Performance. New York, Mc Graw Hill. Head, K., J. Ries, et al. 1994. Agglomeration Benefits And Location Choice:
Evidence From Japanese Manujfacturing Investment In The United States. National Bureau Of Economic Research.
Heizer, J. and B. Render 2010. Operations Management, Prentice Hall. Hertz, D. 1964. Risk Analysis in Capital Investment. Harvard Business
Review: 95-106. Hitchner, J. R. 2006. Financial Valuation, Application and Models, John Wiley
Sons. Holmes, J. F., F. B. Williams, et al. 1972. Facility Location under a Maximum
Travel Restriction: An Example Using Day Care Facilities. Geographical Analysis 4: 258-266.
Hossain, M. S., S. R. Chowdhury, et al. 2009. Integration of GIS and multicriteria decision analysis for urban aquaculture development in
Bangladesh. Landscape and Urban Planning, 903-4: 119-133.
Indagro 2009. Road Map Industri Pengolahan CPO. Jakarta, Direktorat Jenderal Industri Agro dan Kimia.
Indagro 2010. Statistik Indagro 2010, Direktorat Jenderal Industri Agro, Kementrian Perindustrian.
Isard, W. 1975. Transportation research: Some reflections on its development.
Regional Science and Urban Economics 52: 133-135.
Jäger, J. 2009. Land Rent Theory. International Encyclopedia of Human Geography: 112-117.
Jankowski, P. 1995. Integrating geographical information systems and multiple criteria decision-making methods. International Journal of Geographical
Information Systems 9.
Jatmika, A. 2007. Rancang Bangun Sistem Pengembangan Agroindustri Kelapa Sawit Dengan Strategi Pemberdayaan. Program Studi Teknologi Industri
Pertanian. Bogor, IPB. S3.
Karaev, A., S. C. L. Koh, et al. 2007. The cluster approach and SME competitiveness: a review. Journal of Manufacturing Technology
Management 187: 818-835.
Kardiman 2011. Analisis Struktur, Perilaku dan Kinerja Industri Kelapa Sawit di Malaysia dan Implikasinya bagi Pengembangan Industri Kelapa Sawit
Indonesia. Sekolah Pascasarjana Institut Pertanian Bogor. Bogor, IPB. S3.
Keeney, R. L. and H. Raiffa 1976. Decisions with Multiple Objectives: Preferences and Value Tradeoffs. New York, Wiley.
Kelton, W. D., R. P. Sadowski, et al. 2003. Simulation with Arena. New York, Mc Graw Hill.
Kemenperin 2011. Hilirisasi Industri Kelapa Sawit Nasional. Jakarta, Kementrian Perindustrian RI.
Khisty, C. J. and B. K. Lall 2002. Transportation Engineering: An Introduction, Prentice Hall.
Kleindorfer, P. R., H. C. Kunreuther, et al. 1993. Decision Sciences: An Integrated Perspective. Cambridge, Cambridge University Press.
Koo, W. W. and D. W. Larson 1985. Transportation Models for Agricultural Products, Westview Pr.
Krumme, G. 2002. Location-Theoretical Traditions and Significant Concepts. Retrieved
13 Desember
2011, from
http:faculty.washington.edukrumme450traditions.html .
Krumme, G. 2012. Economic Business Geography and the Knowledge- Based Space Economy. Retrieved 24 Pebruari 2012, from
http:faculty.washington.edukrummeebgcontents.html .
Kumar, S. and S. Agrawal 2011. GIS as A Decision Support for Supply Chain Management. Geospatial World Forum. Hyderabad, India.
Kurniawan, I. E. 2011. Hijaukan bumi dengan menanam pohon sawit. Info
Sawit. Jakarta, PT. Mitra Media Nusantara. IV: 8.
Lashine, S. H., M. Fattouh, et al. 2006. Locationallocation and routing decisions in supply chain network design. Journal of Modelling in
Management 12.
LeSage, J. and R. K. Pace 2009. Introduction to Spatial Econometrics, Chapman and HallCRC.
Leung, Y. 1988. Spatial Analysis and Planning Under Imprecision. Amsterdam, North-Holland.
Li, H., C. W. Kong, et al. 2003. Internet based geographical information systems for E-Commerce application in construction material
procurement. Journal
of Construction
Engineering and
Management129: 689-697. Liu, J. G., P. J. Mason, et al. 2012. GIS modelling of earthquake damage zones
using satellite remote sensing and DEM data. Geomorphology 139 –140:
518-535. London, N. A. 1990. School Location in a Developing Nation: A Location-
allocation Modelling Approach. International Journal of Educational Management 45: 13-19.
Longley, P. A., M. Goodchild, et al. 2010. Geographic Information Systems and Science. New York, Wiley.
Louveaux, F., J.-F. Thisse, et al. 1982. Location theory and transportation
costs. Regional Science and Urban Economics 124: 529-545.
Lubis, R. E. and A. Widanarko 2011. Buku Pintar Kelapa Sawit. Jakarta, Agro Media.
Maguire, D. J. 1991. An Overview and Definition of GIS. Geographical Information System: Principles and Applications. D. J. Maguire, M. F.
Goodchild and D. W. Rhind. 1: 9-20.
Maguire, D. J., M. F. Goodchild, et al., Eds. 2005. GIS, Spatial Analysis, and Modeling, ESRI Press.
Malchow, M. B. 2001. An Analysis of Port Selection. Civil and Environmental
Engineering. California, University of California, Berkeley. Doctor of Philosophy
. Malczewski, J. 1999. GIS and Multicriteria Decision Analysis. Canada, John
Wiley Sons. Mangunwidjaya, D. and I. Sailah 2009. Pengantar Teknologi Pertanian. Depok,
Penebar Swadaya. Marianov, V. and D. Serra 1998. Probabilistic, Maximal Covering Location-
Allocation Models for Congested Systems. Journal of Regional Science 38
: 401-425.
Marimin and N. Maghfiroh 2010. Aplikasi Teknik Pengambilan Keputusan dalam Manajemen Rantai Pasok. Bogor, IPB Press.
McHarg, I. L. 1969. Design with nature. Garden City, N.Y, John Wiley Sons. MenkoEkuin 2011. Master Plan Percepatan Dan Perluasan Pembangunan
Ekonomi Indonesia 2011-2025, Kementerian Koordinator Bidang Perekonomian.
Mennecke, B. E. 1997. Understanding the Role of Geographic Information Technologies in Business: Application and Research Directions. Journal
of Geographic Information and Decision Analysis 11: 44-68. Morris, W. T. 1967. On The Art of Modelling. Management Science 1312:
45-50. Mtthew Brian Malchow and A. Kanafani 2001. A disaggregate analysis of
factors influenching port selection. Maritime Policy and Management 28
3: 265-277. Munda, G. 1995. Multicriteria Evaluation in A Fuzzy Environment: Theory and
Applications in Ecological Economics. Heidelberg, Germany, Physica- Verlaag.
Murray, A. T. 2009. Location Theory. International Encyclopedia of Human Geography: 270-276.
Musselman, K. J. 1998. Guidelines for Success. Handbook of Simulation. J. Banks. New York, John Wiley Sons.
Nasution, M. N. 2008. Manajemen Transportasi. Jakarta, Ghalia Indonesia. Nugroho, I. 2008. Agropolitan: Suatu Kerangka Berpikir Baru dalam
Pembangunan Nasional? Journal of Indonesian Applied Economics 22.
OSullivan, D. and G. L. W. Perry 2011. Spatial Simulation: Exploring Pattern and Process, John Wiley.
Ocalir, E. V., O. Y. Ercoskun, et al. 2010. An integrated model of GIS and fuzzy logic FMOTS for location decisions of taxicab stands. Expert
Systems with Applications 377: 4892-4901.
Owen, S. H. and M. S. Daskin 1998. Strategic facility location: A review.
European Journal of Operational Research 111: 423-447.
Pahan, I. 2010. Panduan lengkap kelapa sawit. Jakarta, Penebar Swadaya. Pahan, I., E. Gumbira-
Sa’id, et al. 2011. The Future of Palm Oil Industrial Cluster of Riau Region
– Indonesia. European Journal of Social Sciences
24
3: 421-431. Pardamean, M. 2008. Panduan Lengkap Pengelolaan Kebun dan Pabrik Kelapa
Sawit. Jakarta, PT. Agromedia Pustaka.
Pardamean, M. 2011. Manajemen Risiko Kelapa Sawit. Info Sawit 52: 32-
33. Pearce, J. and R. Robinson 2011. Strategic Management, Mc Graw Hill.
Peet, R. 1970. Von Thünen theory and the dynamics of agricultural expansion.
Explorations in Economic History, 82: 181-201.
Prakash Gaur 2005. Port Planning as a Strategic Tool: A Typology. Institute of Transport and Maritime Management Antwerp University of Antwerp.
Masters of Science in Transport and Maritime
. Pratt, S. P., R. F. Reilly, et al. 2000. Valuing A Business, Mc Graw Hill.
Pressman, R. S. 1997. Software Engineering: A Practitioners Approach. New York, Mc Graw Hill.
Pritsker, A. A. B. 1998. Principles of Simulation Modelling. Handbook of Simulation. J. Banks. New York, John Wiley Sons.
Pujawan, N. 2010. Supply Chain Management. Surabaya, Guna Widya. Rachbini, D. J., B. Arifin, et al. 2011. Outlook Industri 2012: Strategi
Percepatan dan Perluasan Agroindustri. Jakarta, Kementrian Perindustrian Republik Indonesia.
Rachman, B. and Sumedi 2002. Kajian Efisiensi Manajemen dalam Pengelolaan Agroindustri dalam Analisis Kebijakan: Paradigma Pembangunan dan
Kebijaksanaan Pengembangan Agroindustri. Bogor, Pusat Penelitian Sosial Ekonomi Pertanian.
Radiarta, I. N., S.-I. Saitoh, et al. 2008. GIS-based multi-criteria evaluation models for identifying suitable sites for Japanese scallop Mizuhopecten
yessoensis aquaculture in Funka Bay, southwestern Hokkaido, Japan. Aquaculture284: 127
–135. Rajabidfard, Abbas, et al. 2000. Spatial Data Infrastructures : Concept, SDI
Hierarchy and Future Directions. Melbourne, Victoria, Spatial Data Research Group, Department of Geomatics, The University of Melbourne.
Rapaport, E. and F. Snickars 1998. Integration of environmental risk into the road location analysis: A GIS based case study to minimize environmental
impacts, building costs, and travelling time. Retrieved 20 Pebruari 2012, from
http:stratema.sgis.netcupumpdfE8.pdf .
Reid, D. J. 1966. The Theory of Industrial Location, Alfred Webers Contribution Reapprised. Economics and Commerce. Glasgow, Glasgow
University. Resmini, L. 2003. Economic integration, industry location and frontier
economies in transition countries. Economic Systems 27: 205
–221. ReVelle, C. S. and H. A. Eiselt 2005. Location analysis: A synthesis and
survey. European Journal of Operational Research 165: 1-19.
Ristianto, B. 2003. Pendekatan Ekologi-Ekonomi dalam Pengembangan Pelabuhan Dumai. Program Studi Sumberdaya Pesisir dan Lautan. Bogor,
IPB. S2.
Rodrigue, J.-P. 2011. Von Thunens Regional Land Use Model. Retrieved 30 Desember
2012, from
http:people.hofstra.edugeotransengch6enconc6envonthunen.html .
Ruiz, M. C., E. Romero, et al. 2012. Development and application of a multi- criteria spatial decision support system for planning sustainable industrial
areas in Northern Spain. Automation in Construction 22: 320-333.
Rustiadi, E., S. Saefulhakim, et al. 2011. Perencanaan dan Pengembangan Wilayah. Jakarta, Crestpent Press dan Yayasan Pustaka Obor Indonesia.
Saaty, T. L. 1980. The analytical hierarchy process: Planning, priority setting, resource allocation,. New York 1980, McGraw-Hill Book Co.
Saaty, T. L. 1983. Decision Making For Leaders: The Analytical Hierarchy Process for Decision in Complex World. Pittsburg, RWS Publication.
Santé, I., R. Crecente, et al. 2004. A GIS web-based tool for the management of the PGI potato of Galicia. Computers and Electronics in Agriculture44:
161 –171.
Sarkar, A. 2007. GIS Application in Logistics. Redlands, USA, School of Business University of Redlands.
Schiele, H. 2008. Location, location: the geography of industry clusters.
Journal of Business Strategy 293: 29 - 36.
Schietzelt, T. H. and P. Densham 2003 Location-allocation in GIS. Seffino, L. A., C. B. Medeiros, et al. 1999. WOODSS
— a spatial decision
support system based on workflows. Decision Support System 27: 105
– 123.
Sha, Y. and J. Huang 2012. The Multi-period Location-allocation Problem of Engineering Emergency Blood Supply Systems. Systems Engineering
Procedia 521-28.
Shannon, R. E. 1975. System Simulation: The Art and Science. Englewood Cliffs, NJ., Prentice Hall.
Sharifi, M. A., L. Boerboom, et al. 2006. Spatial Multiple Criteria Decision Analysis In Integrated Planning For Public Transport And Land Use
Development Study In Klang Valley, Malaysia. ISPRS Technical Commission II Symposium. Vienna.
Shieh, Y.-N. 1992. Launhardt on Von Thünens rings: A note. Regional
Science and Urban Economics 224: 637-641.
Siahaan, B. 2000. Industrialisasi di Indonesia, Sejak Hutang Kehormatan Sampai Banting Stir. Bandung, Penerbit ITB.
Singhal, S. and A. Kapur 2002. Industrial estate planning and management in India -- an integrated approach towards industrial ecology. Journal of
Environmental Management 66: 19-29.
Sjafrizal 2008. Ekonomi Regional, Teori dan Aplikasi, Baduose Media. Smith 1994. Incorporating Risk into Capital Budgeting Decisions Using
Simulation. Management Decision 329: 20-26.
Soekartiwi 2000. Agroindustri dalam Perspektif Sosial Ekonomi. Jakarta, Rajawali Press.
Sommer, S. and T. Wade, Eds. 2006. A to Z GIS: An Illustrated Dictionary of Geographic Information Systems, Esri Press.
Sprague, R. H. 1980. A Framework for the Development of Decision Support
Systems. MIS Quarterly 44: 1-26. Stevens, S. S. 1964. On the Theory of Scales and Measurements. Science 103:
677-680. Store, R. and J. Kangas 2000. Integrating spatial multi-criteria evaluation and
expert knowledge for GIS-based habitat suitability modelling. Supriyadi 2010. Tantangan Industri CPO Indonesia. Harian Ekonomi Neraca.
Jakarta. Supriyati, E. Suryani, et al. 2006. Analisis Peningkatan Nilai Tambah Melalui
Pengembangan Agroindustri Di Pedesaan. Bogor, Pusat Analisis Sosial Ekonomi Dan Kebijakan Pertanian Badan Penelitian Dan Engembangan
Pertanian Departemen Pertanian.
Suryana, A., D. H. Goenadi, et al. 2007. Prospek Dan Arah Pengembangan Agribisnis Kelapa Sawit, Badan Litbang Pertanian, Departemen Pertanian.
Susila, W. R. 2010. Industri Kelapa Sawit sebagai Lokomotif Ekonomi
Nasional. Info Sawit 41: 33.
Susila, W. R. 2011. Peluang Pengembangan Kelapa Sawit Di Indonesia: Perspektif Jangka Panjang 2025. Bogor, Lembaga Riset Perkebunan
Indonesia,Bogor Indonesia. Syaukat, Y. 2010. Menciptakan daya saing ekonomi dan lingkungan industri
kelapa sawit Indonesia. Agrimedia 151: 17-19.
Tabuchi, T. 1984. The systemic variables and elasticities in Alonsos general,
theory of movement Regional Science and Urban Economics 142: 249- 264.
Tamboen, F. M., A. Dewandhono, et al. 2008. Cetak Biru Penataan Dan Pengembangan Sektor Logistik Indonesia. Jakarta, Kementerian
Koordinator Bidang Perekonomian Republik Indonesia. Tarigan, R. 2010. Perencanaan Pembangunan Wilayah. Jakarta, Bumi Aksara.
TimP3EI 2011. Percepatan Dan Perluasan Pembangunan Ekonomi Indonesia 2011-2025. Jakarta, Kementerian Koordinator Bidang Perekonomian.
Tobler, W. 1970. A computer movie simulating urban growth in the Detroit
region. Economic Geography 462: 234-240.
Turban, E., R. Sharda, et al. 2011. Decision Support and Business Intelligence Systems. New Jersey, Pearson.
Ufron, M. and Setijoprajudo 2010. Studi Penentuan Lokasi Pelabuhan CPO Ekspor dari Wilayah Sumatera Tengah. Jurusan Perkapalan Fakultas
Teknologi Kelautan. Surabaya, ITS. UNEP 2006. Indonesian Current and Planned Palm Oil, United Nations
Environment Programme.
UNIDO 2008. The Importance Of Agro-Industry For Socioeconomic Development And Poverty Reduction. UN Commission On Sustainable
Development. New York, United Nations Industrial Development Organization.
UNSD 2004. International Standard Industrial Classification of All Economic Activities ISIC, Revision 4. Statistical Classifications Section. New
York, United Nations Statistics Division.
Venkataramani, K. 2011. Aviation Biofuels. Info Sawit 511: 50-51.
Vos, B. and H. Akkermans 1996. Capturing the dynamics of facility allocation. International Journal of Operations Production Management
16
11: 57-70. Wei-hua, L., X. Xue-cai, et al. 2011. An emergency order allocation model
based on multi-provider in two-echelon logistics service supply chain. Supply Chain Management: An International Journal 166: 391
–400. Wignjosoebroto, S. 2003. Pengantar Teknik dan Manajemen Industri. Surabaya,
Guna Widya. Wilkinson, J. and R. Rocha 2008. Agro-Industries trends, patterns and
developmental impacts. Global Agroindustries Forum, Improving Competitiveness and Development Impact. New Delhi.
Wilson, A. G. 1974. Urban and Regional Models in Geography and Planning. London, Pion.
WorldBank 2012. Logistics Performance Index. Retrieved 30 Juni 2012, from http:info.worldbank.orgetoolstradesurveymode1b.asp
. Worrall, L. 1991. Spatial Analysis and Spatial Policy Using Geographic
Information System. London, Belhaven Press. Xie, X. 2009.
An integrated sea –land transportation system model and its
theory. Transportation Research C17: 394-411.
Xu, Z. and V. Coors 2012. Combining system dynamics model, GIS and 3D visualization in sustainability assessment of urban residential development
Building and Environment 47: 272-287.
Zhang, F., D. M. Johnson, et al. 2011. A GIS-based method for identifying the optimal location for a facility to convert forest biomass to biofuel.
Biomass and Bioenergy 359: 3951-3961.
Zhou, G., H. Min, et al. 2002. The balanced allocation of retailers to multiple distribution centers in the supply chain network: a genetic algorithm
approach. Computers Industrial Engineering 43: 251-261.
LAMPIRAN
Lampiran 1 Daftar Kebun Kelapa Sawit di Kabupaten Kutei Timur
ID KODE
LUAS Ha
0 KKS-001 18,706
1 KKS-002 148
2 KKS-003 128
3 KKS-004 341
4 KKS-005 12,153
5 KKS-006 9,434
6 KKS-007 12,989
7 KKS-008 967
8 KKS-009 5,113
9 KKS-010 1,567
10 KKS-011 5,975
11 KKS-012 15,960
13 KKS-013 2,264
14 KKS-014 4,535
15 KKS-015 3,425
16 KKS-016 3,335
17 KKS-017 2,424
18 KKS-018 18,235
19 KKS-019 14,581
20 KKS-020 6,087
21 KKS-021 2,476
22 KKS-022 2,479
23 KKS-023 3,951
24 KKS-024 9,051
25 KKS-025 33,301
26 KKS-026 13,907
27 KKS-027 11,797
28 KKS-028 390
29 KKS-029 1,023
30 KKS-030 13,743
31 KKS-031 8,858
32 KKS-032 3,387
33 KKS-033 8,305
35 KKS-034 16,985
36 KKS-035 17,147
37 KKS-036 9,780
38 KKS-037 14,976
39 KKS-038 1,256
40 KKS-039 11,456
41 KKS-040 2,035
ID KODE
LUAS Ha
42 KKS-041 4,082
43 KKS-042 19,134
44 KKS-043 1,424
46 KKS-044 18,176
47 KKS-045 3,073
48 KKS-046 1,274
49 KKS-047 7,288
50 KKS-048 730
51 KKS-049 9,007
52 KKS-050 7,818
53 KKS-051 4,061
54 KKS-052 4,940
56 KKS-053 3,610
57 KKS-054 13,883
58 KKS-055 4,348
59 KKS-056 9,440
60 KKS-057 1,243
61 KKS-058 1,632
62 KKS-059 318
63 KKS-060 239
64 KKS-061 90
65 KKS-062 118
66 KKS-063 2,647
67 KKS-064 133
68 KKS-065 310
69 KKS-066 1,898
70 KKS-067 596
71 KKS-068 340
72 KKS-069 147
73 KKS-070 593
74 KKS-071 4,557
75 KKS-072 3,006
76 KKS-073 9,759
77 KKS-074 9,631
78 KKS-075 14,992
80 KKS-076 5,468
81 KKS-077 1,976
82 KKS-078 4,948
83 KKS-079 1,334
84 KKS-080 6,890
85 KKS-081 2,670
86 KKS-082 3,600
ID KODE
LUAS Ha
88 KKS-083 1,791
89 KKS-084 2,623
90 KKS-085 744
91 KKS-086 7,591
93 KKS-087 1,584
94 KKS-088 982
95 KKS-089 1,446
96 KKS-090 8,220
97 KKS-091 725
98 KKS-092 688
100 KKS-093 2,447
101 KKS-094 501
102 KKS-095 5,442
103 KKS-096 923
104 KKS-097 446
105 KKS-098 1,101
106 KKS-099 4,355
107 KKS-100 1,512
108 KKS-101 739
110 KKS-102 189
111 KKS-103 2,377
112 KKS-104 1,974
113 KKS-105 3,503
114 KKS-106 442
116 KKS-107 329
117 KKS-108 231
118 KKS-109 7,050
119 KKS-110 1,787
120 KKS-111 388
121 KKS-112 405
122 KKS-113 4,245
123 KKS-114 4,325
124 KKS-115 179
125 KKS-116 706
126 KKS-117 322
127 KKS-118 1,249
128 KKS-119 621
129 KKS-120 1,677
130 KKS-121 145
131 KKS-122 265
132 KKS-123 282
133 KKS-124 246
ID KODE
LUAS Ha
134 KKS-125 3,758
135 KKS-126 383
136 KKS-127 5,506
137 KKS-128 1,341
138 KKS-129 423
139 KKS-130 649
140 KKS-131 851
141 KKS-132 6,482
142 KKS-133 10,784
143 KKS-134 5,942
144 KKS-135 1,459
145 KKS-136 4,807
147 KKS-137 11,390
148 KKS-138 7,587
149 KKS-139 465
150 KKS-140 2,817
151 KKS-141 307
152 KKS-142 14,135
153 KKS-143 5,174
154 KKS-144 4,075
155 KKS-145 7,052
156 KKS-146 97
157 KKS-147 6,534
158 KKS-148 7,297
159 KKS-149 793
160 KKS-150 3,101
161 KKS-151 1,275
162 KKS-152 419
163 KKS-153 7,924
164 KKS-154 1,937
165 KKS-155 163
166 KKS-156 641
167 KKS-157 1,617
168 KKS-158 230
169 KKS-159 63
170 KKS-160 1,185
Lampiran 2 Konversi Satuan
1 km
2
= 1.000.000
m
2
1 km
2
= 100
ha
Lampiran 3 Asumsi Produktivitas Berdasarkan Umur Tanaman Pahan, 2010
UMUR PRODUKTIVITAS 1
2 3
7.00 4
15.00 5
19.00 6
23.00 7
26.00 8
28.00 9
28.00 10
28.00 11
28.00 12
28.00 13
28.00 14
26.00 15
25.00 16
24.50 17
24.00 18
23.00 19
23.00 20
22.00 21
21.00 22
20.00 23
19.00 24
18.00 25
17.00 26
17.00 27
17.00 27
Lampiran 4 Harga Tandan Buah Segar Tahun 2012
Periode Harga
RpKg
01 Juni sd 07 Juni 2012 1,511.73
25 Mei sd 31 Mei 2012 1,515.52
18 Mei sd 14 Mei 2012 1,771.41
11 Mei sd 17 Mei 2012 1,771.41
04 Mei sd 10 Mei 2012 1,817.60
27 April sd 03 Mei 2012 1,807.96
20 April sd 26 April 2012 1,863.53
13 April sd 19 April 2012 1,903.20
06 April sd 12 April 2012 1,813.83
30 Maret sd 05 April 1,793.94
23 Maret sd 29 Maret 1,793.94
16 Maret sd 22 Maret 1,811.38
09 Maret sd 15 Maret 1,755.34
02 Maret sd 08 Maret 1,740.78
25 Februari sd 01 Maret 1,694.78
17 Februari sd 24 Februari 1,657.86
10 Februari sd 16 Februari 1,606.96
03 Februari sd 09 Februari 1,597.93
27 Januari sd 02 Februari 1,612.13
06 Januari sd 12 Januari 1,633.42
13 Januari sd 19 Januari 1,671.08
20 Januari sd 26 Januari 1,637.65
01 Januari sd 05 Januari 1,559.67
Sumber: Dinas Perkebunan Propinsi Kalimantan Timur, 2012
Lampiran 5 Harga Tandan Buah Segar per Kg Tahun 2011
Periode Harga RpKg
21 Desember sd 05 Januari 1,876.41
06 Januari sd 20 Januari 1,866.73
21 Januari sd 05 Februari 1,963.51
06 Februari sd 20 Februari 1,895.91
21 Februari sd 05 Maret 1,931.08
06 Maret sd 20 Maret 1,758.78
21 Maret sd 05 April 1,623.61
06 April sd 20 April 1,710.19
21 April sd 05 Mei 1,642.00
06 Mei sd 20 Mei 1,710.19
21 Mei sd 05 Juni 1,715.87
06 Juni sd 20 Juni 1,758.99
21 Juni sd 05 Juli 1,650.36
06 Juli sd 20 Juli 1,453.05
21 Juli sd 05 Agustus 1,464.23
06 Juli sd 20 Agustus 1,544.41
21 Agustus sd 05 September 1,512.20
06 September sd 20 September 1,512.20
21 September sd 05 Oktober 1,533.91
06 Oktober sd 13 Oktober 1,464.72
14 Oktober sd 20 Oktober 1,355.01
21 Oktober sd 27 Oktober 1,364.33
28 Oktober sd 03 November 1,370.46
03 November sd 10 November 1,442.16
11 November sd 17 November 1,466.47
18 November sd 24 November 1,492.39
25 November sd 01 Desember 1,583.26
02 Desember sd 08 Desember 1,553.83
09 Desember sd 15 Desember 1,544.67
16 Desember sd 22 Desember 1,532.67
Sumber: Dinas Perkebunan Propinsi Kalimantan Timur, 2012.
Lampiran 6 Hasil Interaksi Spasial dari Kebun Kelapa Sawit Menuju Ke Pabrik Minyak Kelapa Sawit
Jarak sebagai cost
Dari Tujuan
Biaya per Ton
Alokasi dan Biaya 2012
2013 2014
Alokasi Biaya
Alokasi Biaya
Alokasi Biaya
1 2
3 4
5 6
7 8
9
KKS001 PKS007
119.542 24.324
2.907.735.230 -
- -
- KKS001
PKS010 82.805
12.408 1.027.449.962
- -
- -
KKS001 PKS011
107.207 6.318
677.332.000 -
- -
- KKS002
PKS002 15.933
3.842 61.215.823
3.695 58.873.625
3.621 57.694.559
KKS003 PKS004
15.811 3.583
56.649.484 3.583
56.649.484 3.583
56.649.484 KKS004
PKS004 13.567
9.542 129.459.892
9.542 129.459.892
9.542 129.459.892
KKS005 PKS007
27.308 42.535
1.161.525.363 91.146
2.488.971.218 115.452
3.152.707.799 KKS006
PKS007 102.624
33.019 3.388.555.790
- -
- -
KKS007 PKS009
55.532 29.734
1.651.181.173 -
- -
- KKS007
PKS010 63.949
28.715 1.836.288.127
- -
- -
KKS008 PKS008
20.548 6.769
139.087.056 14.506
298.064.240 18.374
377.542.558 KKS009
PKS007 57.297
48.574 2.783.151.667
- -
- -
KKS010 PKS007
51.564 10.971
565.706.285 -
- -
- KKS021
PKS004 40.898
69.315 2.834.832.393
69.315 2.834.832.393
64.364 2.632.347.286
KKS027 PKS004
55.687 74.100
4.126.433.302 -
- -
- KKS029
PKS004 44.407
28.632 1.271.463.915
- -
- -
KKS030 PKS001
31.719 63.472
2.013.281.634 -
- -
- KKS031
PKS004 31.528
66.432 2.094.463.047
84.147 2.652.980.221
101.863 3.211.528.922
KKS036 PKS001
13.235 34.229
453.013.627 73.347
970.732.142 92.907
1.229.604.635 KKS039
PKS001 5.887
40.094 236.022.673
85.917 505.770.439
108.828 640.641.379
KKS040 PKS001
23.634 26.461
625.377.210 -
- -
- KKS041
PKS001 7.398
38.775 286.847.911
46.938 347.235.777
53.060 392.524.827
KKS042 PKS001
17.160 66.969
1.149.166.744 63.798
1.094.753.392 15.205
260.912.965 KKS048
PKS011 3.664
13.879 50.848.964
16.801 61.554.395
18.992 69.581.636
KKS049 PKS010
4.599 31.523
144.971.503 67.550
310.656.506 85.563
393.496.707 KKS050
PKS011 1.639
74.268 121.711.141
89.903 147.333.935
101.630 166.552.260
KKS051 PKS011
44.433 56.851
2.526.055.594 11.454
508.934.597 -
- KKS052
PKS010 33.064
37.053 1.225.108.535
18.779 620.902.847
- -
KKS053 PKS010
26.119 12.635
330.011.910 27.075
707.168.378 -
- KKS054
PKS009 37.607
48.590 1.827.302.313
69.071 2.597.522.084
15.066 566.580.297
KKS055 PKS010
11.071 15.218
168.473.091 32.610
361.013.766 41.305
457.273.033 KKS056
PKS009 31.242
- -
- -
15.333 479.032.835
KKS056 PKS010
15.699 33.040
518.709.696 70.800
1.111.520.777 74.347
1.167.206.712 KKS057
PKS010 48.594
32.323 1.570.689.220
- -
- -
KKS059 PKS011
13.148 6.043
79.451.587 7.316
96.188.617 8.270
108.731.529 KKS060
PKS011 11.992
6.225 74.648.557
6.704 80.392.598
6.704 80.392.598
KKS061 PKS011
14.524 629
9.135.709 1.347
19.564.070 1.707
24.792.775 KKS062
PKS011 13.906
411 5.715.234
882 12.264.808
1.117 15.532.642
KKS063 PKS011
9.501 30.435
289.157.213 34.405
326.875.437 37.052
352.024.086 KKS064
PKS011 10.860
3.446 37.423.405
3.711 40.301.293
3.711 40.301.293
KKS066 PKS010
8.123 13.284
107.906.091 28.465
231.221.537 36.056
292.883.321
Dari Tujuan
Biaya per Ton
Alokasi dan Biaya 2012
2013 2014
Alokasi Biaya
Alokasi Biaya
Alokasi Biaya
1 2
3 4
5 6
7 8
9
KKS067 PKS010
7.493 -
- 4.173
31.269.311 8.942
67.004.597 KKS068
PKS010 13.322
- -
2.383 31.746.076
5.107 68.034.918
KKS069 PKS010
5.428 -
- -
- 515
2.795.366 KKS071
PKS011 52.185
34.174 1.783.362.193
- -
- -
KKS072 PKS004
35.012 -
- 22.432
785.397.596 39.073
1.368.038.528 KKS072
PKS005 27.067
28.554 772.874.459
12.133 328.405.331
- -
KKS073 PKS005
17.505 34.158
597.936.644 73.195
1.281.280.305 92.714
1.622.960.888 KKS074
PKS005 4.862
33.709 163.879.708
72.234 351.172.887
91.497 444.821.907
KKS075 PKS005
17.867 52.471
937.496.104 112.438
2.008.922.775 85.789
1.532.786.744 KKS076
PKS003 22.908
146.056 3.345.806.885
145.270 3.327.801.434
142.133 3.255.939.982
KKS076 PKS004
39.274 -
- 7.824
307.283.383 10.961
430.487.367 KKS076
PKS005 34.706
7.038 244.258.681
- -
- -
KKS077 PKS004
42.942 48.656
2.089.369.993 55.337
2.376.263.303 -
- KKS077
PKS005 38.373
6.681 256.369.412
- -
- -
KKS078 PKS004
51.961 17.320
899.964.797 -
- -
- KKS079
PKS010 66.907
30.678 2.052.571.504
- -
- -
KKS081 PKS011
11.963 9.345
111.790.731 20.025
239.551.566 25.365
303.431.983 KKS082
PKS004 5.163
- -
12.598 65.038.636
26.997 139.375.144
KKS083 PKS004
8.941 26.870
240.232.632 34.036
304.300.628 41.201
368.359.683 KKS084
PKS004 33.170
24.915 826.419.463
30.160 1.000.393.779
34.094 1.130.882.808
KKS085 PKS004
43.484 5.211
226.597.485 2.187
95.100.499 -
- KKS086
PKS002 19.074
124.187 2.368.780.963
124.418 2.373.187.128
121.833 2.323.880.045
KKS087 PKS002
4.161 44.352
184.545.035 44.352
184.545.035 44.352
184.545.035 KKS088
PKS003 7.286
25.541 186.079.722
24.558 178.918.046
24.067 175.340.851
KKS089 PKS004
55.109 37.604
2.072.318.836 -
- -
- KKS093
PKS004 46.589
68.518 3.192.202.232
- -
- -
KKS094 PKS004
38.185 3.508
133.953.390 7.518
287.075.710 9.523
363.636.869 KKS096
PKS002 12.391
23.077 285.950.753
22.616 280.238.429
22.154 274.513.714
KKS097 PKS002
17.449 -
- -
- 3.121
54.457.592 KKS098
PKS004 16.684
25.312 422.317.279
28.613 477.392.711
30.814 514.115.228
KKS099 PKS004
11.506 30.482
350.725.343 65.319
751.559.238 82.738
951.981.939 KKS102
PKS002 13.623
4.909 66.875.238
5.286 72.011.104
5.286 72.011.104
KKS106 PKS003
16.041 8.403
134.791.531 10.172
163.167.852 11.499
184.454.102 KKS107
PKS003 17.099
- -
- -
2.301 39.344.233
KKS108 PKS002
6.554 6.467
42.384.653 6.467
42.384.653 6.467
42.384.653 KKS109
PKS003 25.073
- -
- -
- -
KKS109 PKS004
41.440 -
- 107.389
4.450.207.677 85.247
3.532.641.647 KKS109
PKS005 36.871
107.389 3.959.572.573
- -
- -
KKS109 PKS006
3.602 90.000
324.163.710 90.000
324.163.710 90.000
324.163.710 KKS110
PKS010 43.699
6.256 273.383.903
- -
- -
KKS111 PKS012
10.724 2.715
29.114.403 5.818
62.389.538 7.369
79.021.744 KKS112
PKS012 8.290
6.068 50.305.862
7.686 63.719.653
9.304 77.133.444
KKS113 PKS012
19.478 118.865
2.315.230.599 82.651
1.609.860.970 61.330
1.194.574.455 KKS114
PKS012 2.737
15.137 41.435.449
32.437 88.791.811
41.087 112.469.992
KKS115 PKS012
6.172 1.252
7.727.044 2.683
16.558.832 3.399
20.977.812
Dari Tujuan
Biaya per Ton
Alokasi dan Biaya 2012
2013 2014
Alokasi Biaya
Alokasi Biaya
Alokasi Biaya
1 2
3 4
5 6
7 8
9
KKS116 PKS012
16.118 10.589
170.674.243 13.412
216.175.555 16.236
261.692.985 KKS117
PKS012 14.449
8.371 120.954.044
9.015 130.259.313
9.015 130.259.313
KKS118 PKS012
4.545 4.370
19.860.444 9.365
42.561.340 11.862
53.909.516 KKS119
PKS012 11.563
4.344 50.229.246
9.309 107.639.055
11.792 136.349.740
KKS122 PKS012
21.967 2.910
63.924.113 -
- -
- KKS123
PKS012 17.500
3.660 64.048.584
3.941 68.965.975
3.941 68.965.975
KKS124 PKS012
9.736 1.719
16.736.493 3.683
35.858.351 4.665
45.419.280 KKS125
PKS011 23.150
- -
13.154 304.517.362
28.187 652.533.898
KKS126 PKS011
16.364 5.747
94.042.402 7.279
119.111.649 8.812
144.197.259 KKS127
PKS011 28.614
19.270 551.384.111
41.293 1.181.541.467
311 8.898.830
KKS128 PKS011
6.237 -
- 9.385
58.531.420 20.110
125.420.017 KKS129
PKS011 10.110
2.959 29.914.253
6.341 64.104.859
8.032 81.200.163
KKS130 PKS010
10.781 16.867
181.847.732 18.165
195.841.824 18.165
195.841.824 KKS132
PKS009 12.809
61.580 788.785.055
74.545 954.855.179
84.268 1.079.398.166
KKS133 PKS007
36.943 -
- 55.285
2.042.418.357 15.364
567.599.089 KKS134
PKS009 5.541
44.564 246.932.734
56.447 312.777.399
68.331 378.627.606
KKS135 PKS008
38.229 10.213
390.435.208 21.885
836.646.874 953
36.432.464 KKS136
PKS008 45.897
16.825 772.218.926
33.840 1.553.158.304
- -
KKS137 PKS008
60.822 39.865
2.424.653.004 -
- -
- KKS138
PKS008 32.913
26.553 873.935.889
56.900 1.872.743.270
72.073 2.372.130.505
KKS139 PKS008
27.877 10.702
298.344.502 12.098
337.261.426 13.029
363.215.335 KKS140
PKS007 1.258
- -
9.859 12.403.361
21.126 26.578.092
KKS141 PKS007
4.361 4.605
20.084.261 5.833
25.440.064 7.061
30.795.867 KKS142
PKS008 53.262
49.474 2.635.087.453
- -
- -
KKS143 PKS008
7.081 -
- 18.111
128.240.405 38.808
274.791.764 KKS144
PKS008 12.947
52.970 685.796.975
57.044 738.542.621
57.044 738.542.621
KKS145 PKS008
4.009 24.680
98.953.695 52.887
212.048.787 66.990
268.594.328 KKS146
PKS008 6.164
2.534 15.620.291
2.729 16.822.326
2.729 16.822.326
KKS148 PKS009
26.097 25.539
666.501.499 54.727
1.428.232.410 69.321
1.809.097.865 KKS149
PKS009 29.404
7.535 221.557.829
9.121 268.192.297
10.310 303.153.446
KKS150 PKS009
39.325 10.854
426.837.913 -
- -
- KKS151
PKS008 57.916
4.461 258.364.097
- -
- -
KKS153 PKS007
89.503 2.781
248.907.996 -
- -
- KKS153
PKS008 74.203
24.954 1.851.658.742
- -
- -
KKS154 PKS009
52.301 36.797
1.924.525.785 -
- -
- KKS155
PKS007 96.093
1.553 149.231.882
- -
- -
KKS156 PKS009
18.045 4.807
86.742.945 6.089
109.876.803 7.371
133.010.661 KKS157
PKS007 16.311
5.661 92.338.943
12.130 197.857.512
15.365 250.624.953
KKS158 PKS007
6.860 5.977
41.002.483 5.747
39.424.673 5.632
38.635.768 KKS160
PKS002 5.392
33.166 178.833.493
33.166 178.833.493
33.166 178.833.493
Total
3.030.004 88.315.316.549
3.030.006 56.422.721.814
3.030.008 48.384.137.274
Waktu Tempuh Sebagai Cost
Dari Tujuan
Biaya per Ton
Alokasi dan Biaya 2012
2013 2014
Alokasi Biaya
Alokasi Biaya
Alokasi Biaya
1 2
3 4
5 6
7 8
9
KKS001 PKS007
2,8930 24.324
70.369 -
- -
- KKS001
PKS010 1,9070
12.408 23.662
- -
- -
KKS001 PKS011
2,3660 6.318
14.948 -
- -
- KKS002
PKS002 0,3700
3.842 1.422
3.695 1.367
3.621 1.340
KKS003 PKS003
0,4170 -
- 3.583
1.494 3.583
1.494 KKS003
PKS004 0,4530
- -
- -
- -
KKS003 PKS005
0,3870 3.583
1.387 -
- -
- KKS004
PKS004 0,4080
9.542 3.893
9.542 3.893
9.542 3.893
KKS005 PKS007
0,5440 42.535
23.139 70.944
38.594 -
- KKS006
PKS007 1,8280
33.019 60.359
- -
- -
KKS007 PKS009
1,3050 29.734
38.803 -
- -
- KKS007
PKS010 1,5540
28.715 44.623
- -
- -
KKS008 PKS008
0,3180 6.769
2.153 14.506
4.613 18.374
5.843 KKS009
PKS007 0,7180
48.574 34.876
- -
- -
KKS010 PKS007
1,1260 10.971
12.353 -
- -
- KKS021
PKS004 0,9390
69.315 65.087
69.315 65.087
64.364 60.438
KKS030 PKS001
1,2360 63.472
78.451 -
- -
- KKS031
PKS004 0,7780
66.432 51.684
84.147 65.466
101.863 79.249
KKS036 PKS001
0,4390 34.229
15.027 73.347
32.199 92.907
40.786 KKS039
PKS001 0,2230
40.094 8.941
85.917 19.159
108.828 24.269
KKS040 PKS001
0,7590 26.461
20.084 -
- -
- KKS041
PKS001 0,2450
38.775 9.500
46.938 11.500
53.060 13.000
KKS042 PKS001
0,6650 66.969
44.534 63.798
42.426 15.205
10.111 KKS048
PKS011 0,0740
13.879 1.027
16.801 1.243
18.992 1.405
KKS049 PKS010
0,1510 31.523
4.760 67.550
10.200 85.563
12.920 KKS050
PKS011 0,0210
74.268 1.560
89.903 1.888
101.630 2.134
KKS051 PKS011
0,5550 56.851
31.552 11.454
6.357 -
- KKS052
PKS010 0,8250
37.053 30.569
18.779 15.493
- -
KKS053 PKS010
0,6520 12.635
8.238 27.075
17.653 -
- KKS054
PKS009 0,8210
48.590 39.892
69.071 56.707
30.399 24.958
KKS055 PKS010
0,2760 15.218
4.200 32.610
9.000 41.305
11.400 KKS056
PKS010 0,3920
33.040 12.952
70.800 27.754
74.347 29.144
KKS057 PKS010
1,2130 32.323
39.208 -
- -
- KKS059
PKS010 0,3550
- -
- -
- -
KKS059 PKS011
0,2640 6.043
1.595 7.316
1.931 8.270
2.183 KKS060
PKS011 0,2410
6.225 1.500
6.704 1.616
6.704 1.616
KKS061 PKS010
0,3280 -
- -
- -
- KKS061
PKS011 0,2920
629 184
1.347 393
1.707 498
KKS062 PKS010
0,3400 -
- -
- -
- KKS062
PKS011 0,2800
411 115
882 247
1.117 313
KKS063 PKS011
0,1910 30.435
5.813 34.405
6.571 37.052
7.077 KKS064
PKS011 0,2180
3.446 751
3.711 809
3.711 809
KKS066 PKS010
0,2030 13.284
2.697 28.465
5.778 36.056
7.319
Dari Tujuan
Biaya per Ton
Alokasi dan Biaya 2012
2013 2014
Alokasi Biaya
Alokasi Biaya
Alokasi Biaya
1 2
3 4
5 6
7 8
9
KKS067 PKS010
0,1820 -
- 4.173
759 8.942
1.627 KKS068
PKS010 0,2990
- -
2.383 713
5.107 1.527
KKS069 PKS010
0,1400 -
- -
- 515
72 KKS071
PKS011 0,6520
34.174 22.281
- -
- -
KKS072 PKS004
0,7050 -
- 32.604
22.986 39.073
27.546 KKS072
PKS005 0,3850
28.554 10.993
1.961 755
- -
KKS073 PKS005
0,2490 34.158
8.505 73.195
18.226 92.714
23.086 KKS074
PKS005 0,0690
33.709 2.326
72.234 4.984
91.497 6.313
KKS075 PKS003
0,6450 -
- -
- 24.998
16.124 KKS075
PKS004 0,8360
- -
- -
31.635 26.447
KKS075 PKS005
0,2540 52.471
13.328 112.438
28.559 85.789
21.790 KKS076
PKS003 0,6600
98.665 65.119
57.927 38.232
- -
KKS076 PKS004
0,9700 -
- 95.167
92.312 153.094
148.501 KKS076
PKS005 0,8300
54.429 45.176
- -
- -
KKS077 PKS004
1,0620 644
684 55.337
58.768 28.614
30.388 KKS077
PKS005 0,9210
54.693 50.372
- -
- -
KKS078 PKS004
1,2860 17.320
22.274 -
- -
- KKS079
PKS010 1,6700
30.678 51.232
- -
- -
KKS081 PKS011
0,1490 9.345
1.392 20.025
2.984 25.365
3.779 KKS082
PKS004 0,1700
- -
12.598 2.142
26.997 4.589
KKS083 PKS004
0,2940 26.870
7.900 34.036
10.007 41.201
12.113 KKS084
PKS004 0,8690
24.915 21.651
30.160 26.209
34.094 29.628
KKS086 PKS004
1,2920 126.452
163.376 -
- -
- KKS087
PKS002 0,0810
44.352 3.593
44.352 3.593
44.352 3.593
KKS088 PKS003
0,1680 25.541
4.291 24.558
4.126 24.067
4.043 KKS093
PKS004 1,1280
68.518 77.288
2.187 2.467
- -
KKS094 PKS004
0,8690 3.508
3.048 7.518
6.533 9.523
8.275 KKS095
PKS002 0,4410
124.187 54.766
124.418 54.868
121.833 53.728
KKS095 PKS004
1,2310 17.318
21.318 -
- -
- KKS096
PKS002 0,2810
23.077 6.485
22.616 6.355
22.154 6.225
KKS097 PKS002
0,3830 -
- -
- 3.121
1.195 KKS098
PKS003 0,3250
25.312 8.226
28.613 9.299
30.814 10.015
KKS099 PKS003
0,2210 30.482
6.737 65.319
14.435 82.738
18.285 KKS102
PKS002 0,3210
4.909 1.576
5.286 1.697
5.286 1.697
KKS106 PKS003
0,3430 -
- -
- 11.499
3.944 KKS106
PKS005 0,3120
8.403 2.622
10.172 3.174
- -
KKS107 PKS003
0,3640 -
- -
- 2.301
838 KKS107
PKS004 0,5060
- -
- -
- -
KKS108 PKS002
0,1300 6.467
841 6.467
841 6.467
841 KKS109
PKS004 1,0810
107.389 116.088
107.389 116.088
- -
KKS109 PKS006
0,1190 90.000
10.710 90.000
10.710 90.000
10.710 KKS110
PKS010 1,0910
6.256 6.825
- -
- -
KKS111 PKS012
0,1560 2.715
424 5.818
908 7.369
1.150 KKS112
PKS012 0,1070
6.068 649
7.686 822
9.304 996
KKS113 PKS012
0,3320 118.865
39.463 82.651
27.440 61.330
20.362
Dari Tujuan
Biaya per Ton
Alokasi dan Biaya 2012
2013 2014
Alokasi Biaya
Alokasi Biaya
Alokasi Biaya
1 2
3 4
5 6
7 8
9
KKS114 PKS012
0,0340 15.137
515 32.437
1.103 41.087
1.397 KKS115
PKS012 0,0780
1.252 98
2.683 209
3.399 265
KKS116 PKS012
0,2640 10.589
2.795 13.412
3.541 16.236
4.286 KKS117
PKS012 0,2310
8.371 1.934
9.015 2.082
9.015 2.082
KKS118 PKS012
0,1130 4.370
494 9.365
1.058 11.862
1.340 KKS119
PKS012 0,1950
4.344 847
9.309 1.815
11.792 2.299
KKS122 PKS012
0,3820 2.910
1.112 -
- -
- KKS123
PKS012 0,2920
3.660 1.069
3.941 1.151
3.941 1.151
KKS124 PKS012
0,2430 1.719
418 3.683
895 4.665
1.134 KKS125
PKS011 0,2890
- -
13.154 3.802
28.187 8.146
KKS126 PKS011
0,2040 5.747
1.172 7.279
1.485 8.812
1.798 KKS127
PKS011 0,3570
19.270 6.879
41.293 14.742
311 111
KKS128 PKS011
0,0780 -
- 9.385
732 20.110
1.569 KKS129
PKS011 0,1260
2.959 373
6.341 799
8.032 1.012
KKS130 PKS010
0,2480 16.867
4.183 18.165
4.505 18.165
4.505 KKS132
PKS009 0,3530
61.580 21.738
74.545 26.314
84.268 29.747
KKS133 PKS007
0,4640 -
- 75.487
35.026 130.816
60.699 KKS134
PKS009 0,1840
44.564 8.200
56.447 10.386
68.331 12.573
KKS135 PKS008
0,5710 10.213
5.832 21.885
12.496 953
544 KKS136
PKS008 0,6810
16.825 11.458
33.840 23.045
- -
KKS137 PKS008
0,8950 39.865
35.679 -
- -
- KKS138
PKS008 0,4950
26.553 13.144
56.900 28.166
72.073 35.676
KKS139 PKS008
0,4230 10.702
4.527 12.098
5.117 13.029
5.511 KKS140
PKS007 0,0250
- -
9.859 246
21.126 528
KKS141 PKS007
0,0870 4.605
401 5.833
507 7.061
614 KKS142
PKS008 0,7860
49.474 38.887
- -
- -
KKS143 PKS008
0,1250 -
- 18.111
2.264 38.808
4.851 KKS144
PKS008 0,3670
52.970 19.440
57.044 20.935
57.044 20.935
KKS145 PKS008
0,0800 24.680
1.974 52.887
4.231 66.990
5.359 KKS146
PKS008 0,1230
2.534 312
2.729 336
2.729 336
KKS148 PKS009
0,6860 25.539
17.520 54.727
37.543 69.321
47.554 KKS149
PKS009 0,7020
7.535 5.290
9.121 6.403
10.310 7.238
KKS150 PKS009
1,0130 10.854
10.995 -
- -
- KKS151
PKS008 0,8530
4.461 3.805
- -
- -
KKS153 PKS007
1,3930 2.781
3.874 -
- -
- KKS153
PKS008 1,0860
24.954 27.100
- -
- -
KKS154 PKS009
1,1300 36.797
41.581 -
- -
- KKS155
PKS007 1,4870
1.553 2.309
- -
- -
KKS156 PKS009
0,4850 4.807
2.331 6.089
2.953 7.371
3.575 KKS157
PKS007 0,2060
5.661 1.166
12.130 2.499
15.365 3.165
KKS158 PKS007
0,1370 5.977
819 5.747
787 5.632
772 KKS159
PKS004 1,2460
1.777 2.214
- -
- -
KKS160 PKS002
0,1310 33.166
4.345 33.166
4.345 33.166
4.345
Total 3.030.004
1.970.299 3.030.006
1.281.955 3.030.008
1.116.753
Biaya Transportasi Sebagai Cost
Dari Tujuan
Biaya per Ton Alokasi dan Biaya
2012 2013
Alokasi Biaya
Alokasi Biaya
1 2
3 4
5 6
7
KKS001 PKS007
100.667 24.324
2.448.630.943 -
- KKS001
PKS010 68.504
12.408 849.996.280
- -
KKS001 PKS011
86.196 6.318
544.583.365 -
- KKS002
PKS002 12.941
3.842 49.719.660
3.695 47.817.320
KKS003 PKS004
14.519 3.583
52.020.438 3.583
52.020.438 KKS004
PKS004 12.836
9.542 122.483.402
9.542 122.483.402
KKS005 PKS007
20.481 42.535
871.144.065 70.944
1.452.978.595 KKS006
PKS007 74.951
33.019 2.474.793.399
- -
KKS007 PKS009
47.183 29.734
1.402.938.638 -
- KKS007
PKS010 55.195
28.715 1.584.926.320
- -
KKS008 PKS008
13.020 6.769
88.134.302 14.506
188.872.240 KKS009
PKS007 28.731
48.574 1.395.582.168
- -
KKS010 PKS007
41.615 10.971
456.562.575 -
- KKS021
PKS004 33.893
69.315 2.349.304.385
69.315 2.349.304.385
KKS030 PKS001
44.158 63.472
2.802.785.913 -
- KKS031
PKS004 28.349
66.432 1.883.293.988
84.147 2.385.500.048
KKS036 PKS001
13.235 34.229
453.013.661 73.347
970.732.215 KKS039
PKS001 7.770
40.094 311.528.455
85.917 667.570.966
KKS040 PKS001
23.340 26.461
617.594.527 28.497
665.114.366 KKS041
PKS001 7.398
38.775 286.847.950
46.938 347.235.824
KKS042 PKS001
23.649 66.969
1.583.759.056 35.301
834.838.185 KKS048
PKS011 2.748
13.879 38.136.716
16.801 46.165.788
KKS049 PKS010
4.599 31.523
144.971.471 67.550
310.656.438 KKS050
PKS011 822
74.268 61.040.201
89.903 73.890.467
KKS051 PKS011
22.219 56.851
1.263.169.128 11.454
254.495.773 KKS052
PKS010 29.757
37.053 1.102.597.570
18.779 558.812.506
KKS053 PKS010
23.507 12.635
297.010.692 27.075
636.451.484 KKS054
PKS009 29.834
48.590 1.449.625.800
69.071 2.060.652.472
KKS055 PKS010
9.964 15.218
151.625.760 32.610
324.912.344 KKS056
PKS009 29.267
- -
- -
KKS056 PKS010
14.130 33.040
466.838.713 70.800
1.000.368.671 KKS057
PKS010 43.734
32.323 1.413.620.256
- -
KKS059 PKS009
22.968 -
- -
- KKS059
PKS010 12.705
- -
- -
KKS059 PKS011
9.861 6.043
59.588.675 7.316
72.141.445 KKS060
PKS011 8.994
6.225 55.986.411
6.704 60.294.442
KKS061 PKS010
11.673 -
- -
- KKS061
PKS011 10.893
629 6.851.780
1.347 14.673.049
KKS062 PKS010
12.137 -
- -
- KKS062
PKS011 10.429
411 4.286.424
882 9.198.604
KKS063 PKS011
7.126 30.435
216.867.849 34.405
245.156.509 KKS064
PKS011 8.145
3.446 28.067.546
3.711 30.225.961
Dari Tujuan
Biaya per Ton Alokasi dan Biaya
2012 2013
Alokasi Biaya
Alokasi Biaya
1 2
3 4
5 6
7
KKS066 PKS010
7.311 13.284
97.115.472 28.465
208.099.360 KKS067
PKS010 6.229
- -
4.173 25.994.593
KKS068 PKS010
10.601 -
- 2.383
25.261.518 KKS069
PKS010 4.680
- -
- -
KKS071 PKS011
26.095 34.174
891.765.917 -
- KKS072
PKS004 26.942
- -
22.432 604.372.500
KKS072 PKS005
16.263 28.554
464.370.761 12.133
197.317.729 KKS073
PKS005 10.518
34.158 359.261.786
73.195 769.839.172
KKS074 PKS005
2.921 33.709
98.464.798 72.234
210.997.248 KKS075
PKS004 32.470
- -
- -
KKS075 PKS005
10.735 52.471
563.281.380 112.438
1.207.033.061 KKS076
PKS003 20.912
90.262 1.887.556.687
51.338 1.073.578.973
KKS076 PKS004
31.693 -
- 101.756
3.224.990.659 KKS076
PKS005 28.634
62.832 1.799.112.199
- -
KKS077 PKS004
34.994 55.337
1.936.455.397 55.337
1.936.455.397 KKS078
PKS004 43.111
17.320 746.687.248
- -
KKS079 PKS010
60.216 30.678
1.847.314.118 -
- KKS081
PKS011 5.984
9.345 55.918.602
20.025 119.825.575
KKS082 PKS004
5.163 -
- 12.598
65.038.624 KKS083
PKS004 8.941
26.870 240.232.605
34.036 304.300.594
KKS084 PKS004
31.759 24.915
791.278.101 30.160
957.854.607 KKS086
PKS004 45.162
126.452 5.710.838.122
- -
KKS087 PKS002
3.099 44.352
137.462.194 44.352
137.462.194 KKS088
PKS003 5.996
25.541 153.138.472
24.558 147.244.611
KKS093 PKS004
39.585 68.518
2.712.256.664 2.187
86.571.490 KKS094
PKS004 31.426
3.508 110.240.886
7.518 236.257.405
KKS095 PKS002
15.576 124.187
1.934.296.724 124.418
1.937.894.705 KKS095
PKS004 44.332
17.318 767.739.879
- -
KKS096 PKS002
9.754 23.077
225.086.873 22.616
220.590.403 KKS097
PKS002 13.434
- -
- -
KKS098 PKS003
12.137 25.312
307.215.237 28.613
347.279.930 KKS099
PKS003 8.253
30.482 251.576.237
65.319 539.095.474
KKS102 PKS002
10.955 4.909
53.775.925 5.286
57.905.794 KKS106
PKS003 12.457
8.403 104.679.515
10.172 126.716.652
KKS107 PKS003
13.251 -
- -
- KKS107
PKS004 16.521
- -
- -
KKS108 PKS002
4.894 6.467
31.650.475 6.467
31.650.475 KKS109
PKS004 34.343
49.113 1.686.673.172
107.389 3.688.028.532
KKS109 PKS005
31.283 58.276
1.823.049.565 -
- KKS109
PKS006 3.602
90.000 324.163.710
90.000 324.163.710
KKS110 PKS010
39.330 6.256
246.045.496 -
- KKS111
PKS012 6.059
2.715 16.449.802
5.818 35.250.442
KKS112 PKS012
4.234 6.068
25.691.736 7.686
32.542.301 KKS113
PKS012 12.625
118.865 1.500.619.275
82.651 1.043.433.170
KKS114 PKS012
1.369 15.137
20.717.739 32.437
44.395.938
Dari Tujuan
Biaya per Ton Alokasi dan Biaya
2012 2013
Alokasi Biaya
Alokasi Biaya
1 2
3 4
5 6
7
KKS115 PKS012
3.086 1.252
3.863.527 2.683
8.279.427 KKS116
PKS012 10.105
10.589 106.999.304
13.412 135.525.041
KKS117 PKS012
8.853 8.371
74.109.200 9.015
79.810.588 KKS118
PKS012 4.090
4.370 17.872.649
9.365 38.301.455
KKS119 PKS012
7.233 4.344
31.418.149 9.309
67.327.706 KKS122
PKS012 14.491
2.910 42.170.248
- -
KKS123 PKS012
11.141 3.660
40.775.760 3.941
43.906.358 KKS124
PKS012 8.762
1.719 15.062.151
3.683 32.271.032
KKS125 PKS011
11.578 -
- 13.154
152.291.356 KKS126
PKS011 8.184
5.747 47.035.494
7.279 59.573.927
KKS127 PKS011
14.309 19.270
275.739.960 41.293
590.873.388 KKS128
PKS011 3.121
- -
9.385 29.289.027
KKS129 PKS011
5.057 2.959
14.964.480 6.341
32.068.187 KKS130
PKS010 8.695
16.867 146.662.849
18.165 157.949.289
KKS132 PKS009
11.884 61.580
731.845.724 74.545
885.927.891 KKS133
PKS007 18.554
- -
75.487 1.400.600.971
KKS134 PKS009
5.541 44.564
246.932.778 56.447
312.777.456 KKS135
PKS008 23.629
10.213 241.325.408
21.885 517.125.874
KKS136 PKS008
28.230 16.825
474.969.161 33.840
955.302.016 KKS137
PKS008 37.185
39.865 1.482.366.152
- -
KKS138 PKS008
20.439 26.553
542.728.185 56.900
1.163.003.567 KKS139
PKS008 17.418
10.702 186.409.234
12.098 210.724.996
KKS140 PKS007
944 -
- 9.859
9.302.499 KKS141
PKS007 3.271
4.605 15.063.194
5.833 19.080.046
KKS142 PKS008
32.649 49.474
1.615.273.559 -
- KKS143
PKS008 4.940
- -
18.111 89.471.528
KKS144 PKS008
11.794 52.970
624.731.464 57.044
672.780.473 KKS145
PKS008 3.007
24.680 74.215.277
52.887 159.036.603
KKS146 PKS008
4.623 2.534
11.715.219 2.729
12.616.746 KKS148
PKS009 23.844
25.539 608.950.179
54.727 1.304.906.867
KKS149 PKS009
24.912 7.535
187.713.374 9.121
227.224.112 KKS150
PKS009 35.749
10.854 388.021.090
- -
KKS151 PKS008
35.441 4.461
158.104.094 -
- KKS153
PKS007 56.689
2.781 157.650.871
- -
KKS153 PKS008
45.213 24.954
1.128.255.733 -
- KKS154
PKS009 41.404
36.797 1.523.549.906
- -
KKS155 PKS007
60.642 1.553
94.177.512 -
- KKS156
PKS009 16.597
4.807 79.781.265
6.089 101.058.481
KKS157 PKS007
8.238 5.661
46.636.388 12.130
99.929.233 KKS158
PKS007 5.145
5.977 30.751.862
5.747 29.568.505
KKS159 PKS004
44.485 1.777
79.049.824 -
- KKS160
PKS002 4.807
33.166 159.436.955
33.166 159.436.955
Total 3.030.004
71.018.439.439 3.030.006
45.507.348.375
Lampiran 7 Kapasitas Pabrik Pengolahan TBS
NO PABRIK
2012 2013
2014 2015
1 PKS001
270,000 270,000
270,000 270,000
2 PKS002
240,000 240,000
240,000 240,000
3 PKS003
180,000 180,000
180,000 180,000
4 PKS004
540,000 540,000
540,000 540,000
5 PKS005
270,000 270,000
270,000 270,000
6 PKS006
90,000 90,000
90,000 90,000
7 PKS007
180,000 180,000
180,000 180,000
8 PKS008
270,000 270,000
270,000 270,000
9 PKS009
270,000 270,000
270,000 270,000
10 PKS010
270,000 270,000
270,000 270,000
11 PKS011
270,000 270,000
270,000 270,000
12 PKS012
180,000 180,000
180,000 180,000
3,030,000 3,030,000
3,030,000 3,030,000
Lampiran 8 Listing Program =======================================================
= Spatial Decision Support System for Palm Oil Industry =
= By: I.K. Gunarta 2011 = TIP IPB Bogor
= Date: 18 Pebruari 2011
‘= Form: Add Palm Oil Plantation ========================================================
Public Lat As Single Public Lon As Single
Private mLabelPos As String Private Sub cmdCancel_Click
Unload Me End Sub
Private Sub cmdOK_Click If TrimtxtPointName.Text Then
SavePoint Unload Me
End If End Sub
Private Sub Form_Load txtLat.Text = Lat
txtLon.Text = Lon mLabelPos = optLabelPos0.Caption
cboOwner.ListIndex = 0 txtYOP.Text = YearDate
FillCombo cboFactory, SELECT PointName FROM Points WHERE PointType=FACTORY
If cboFactory.ListCount 0 Then cboFactory.ListIndex = 0
End If End Sub
Private Sub SavePoint Dim SQL As String
Dim Lat As Single Dim Lon As Single
Dim Factory As String On Error GoTo ErrHandler
SQL = INSERT INTO Points VALUES txtPointName.Text , _
txtLat.Text , txtLon.Text , PLANTATION, mLabelPos
cn.Execute SQL
SQL =
INSERT INTO
Plantations VALUES
txtPointName.Text , _ cboOwner.Text , txtOwnerName.Text ,
ValtxtLarge.Text , ValtxtYOP.Text , _ ValtxtSalePrice.Text , CStroptYes.Value
, cboFactory.Text cn.Execute SQL
GetLabelLatLon mLabelPos, txtLat.Text, txtLon.Text, Lat, Lon
SQL = INSERT INTO LabelsLat, Lon, Label _ VALUES Lat , Lon ,
txtPointName.Text cn.Execute SQL
Exit Sub ErrHandler:
Alert End Sub
Private Sub optLabelPos_ClickIndex As Integer mLabelPos = optLabelPosIndex.Caption
End Sub Private Sub optNo_Click
lblFactory.Visible = False cboFactory.Visible = False
End Sub Private Sub optYes_Click
lblFactory.Visible = True cboFactory.Visible = True
End Sub
Form Tambah Pabrik CPO
Public Lat As Single Public Lon As Single
Private mLabelPos As String Private Sub cmdCancel_Click
Unload Me End Sub
Private Sub cmdOK_Click If TrimtxtPointName.Text Then
SavePoint Unload Me
End If End Sub
Private Sub Form_Load txtLat.Text = Lat
txtLon.Text = Lon mLabelPos = optLabelPos0.Caption
cboOwner.ListIndex = 0 End Sub
Private Sub SavePoint
Dim SQL As String Dim Lat As Single
Dim Lon As Single On Error GoTo ErrHandler
SQL = INSERT INTO Points VALUES txtPointName.Text , _
txtLat.Text , txtLon.Text , FACTORY, mLabelPos
cn.Execute SQL SQL
= INSERT
INTO Factories
VALUES txtPointName.Text , _
cboOwner.Text , txtOwnerName.Text , ValtxtYOB.Text , _
ValtxtProdCapacity.Text ,
ValtxtYield.Text , _ ValtxtSalePrice.Text , cboMarket.Text
cn.Execute SQL GetLabelLatLon mLabelPos, txtLat.Text, txtLon.Text, Lat,
Lon SQL = INSERT INTO LabelsLat, Lon, Label _
VALUES Lat , Lon , txtPointName.Text
cn.Execute SQL Exit Sub
ErrHandler: Alert
End Sub Private Sub optLabelPos_ClickIndex As Integer
mLabelPos = optLabelPosIndex.Caption End Sub
Form Add Pelabuhan
Public Lat As Single Public Lon As Single
Private mLabelPos As String Private Sub cmdCancel_Click
Unload Me End Sub
Private Sub cmdOK_Click If TrimtxtPointName.Text Then
SavePoint Unload Me
End If End Sub
Private Sub Form_Load txtLat.Text = Lat
txtLon.Text = Lon mLabelPos = optLabelPos0.Caption
cboOwner.ListIndex = 0 End Sub
Private Sub SavePoint Dim SQL As String
Dim Lat As Single Dim Lon As Single
On Error GoTo ErrHandler SQL = INSERT INTO Points VALUES txtPointName.Text
, _ txtLat.Text , txtLon.Text , PORT,
mLabelPos cn.Execute SQL
SQL = INSERT INTO Ports VALUES txtPointName.Text , _
cboOwner.Text , txtOwnerName.Text , ValtxtWaterDepth.Text , _
ValtxtPiledTankCapacity.Text
, ValtxtDWT.Text , _
ValtxtLoadSpeed.Text ,
ValtxtDockedShipCost.Text , _ ValtxtLoadCost.Text
, ValtxtUnloadCost.Text , ValtxtPiledTankCost.Text
, ValtxtShipServiceCost.Text cn.Execute SQL
GetLabelLatLon mLabelPos, txtLat.Text, txtLon.Text, Lat, Lon
SQL = INSERT INTO LabelsLat, Lon, Label _ VALUES Lat , Lon ,
txtPointName.Text cn.Execute SQL
Exit Sub ErrHandler:
Alert End Sub
Private Sub optLabelPos_ClickIndex As Integer mLabelPos = optLabelPosIndex.Caption
End Sub Form Add Point
Public Lat As Single Public Lon As Single
Private mLabelPos As String Private Sub cmdCancel_Click
Unload Me End Sub
Private Sub cmdOK_Click If TrimtxtPointName.Text Then
SavePoint Unload Me
End If End Sub
Private Sub Form_Load txtLat.Text = Lat
txtLon.Text = Lon mLabelPos = optLabelPos0.Caption
End Sub Private Sub SavePoint
Dim SQL As String Dim Lat As Single
Dim Lon As Single On Error GoTo ErrHandler
SQL = INSERT INTO Points VALUES txtPointName.Text , _
txtLat.Text
, txtLon.Text
, INTERSECTION, mLabelPos
cn.Execute SQL GetLabelLatLon mLabelPos, txtLat.Text, txtLon.Text, Lat,
Lon
SQL = INSERT INTO LabelsLat, Lon, Label _ VALUES Lat , Lon ,
txtPointName.Text cn.Execute SQL
Exit Sub ErrHandler:
Alert End Sub
Private Sub optLabelPos_ClickIndex As Integer mLabelPos = optLabelPosIndex.Caption
End Sub Form Symbol dan Layer
Option Explicit Public ParentForm As frmDoc
Public ActiveLayer As MapObjects2.MapLayer Private strMarkerStyle4 As String
Private strLineStyle4 As String Private strFillStyle10 As String
Private strPanelDesc5 As String Private lyr As MapObjects2.MapLayer
Private recs As MapObjects2.Recordset Private tDesc As MapObjects2.TableDesc
Private flds As MapObjects2.Fields Private a As Integer
Private vmr As MapObjects2.ValueMapRenderer Private cbr As MapObjects2.ClassBreaksRenderer
Private lr As MapObjects2.LabelRenderer Private lp As MapObjects2.LabelPlacer
Private zRend As MapObjects2.ZRenderer Private colorMask, colorText As Long
Private justOpened As Boolean Private lFactor As Double
Private Sub Form_Load Position this form into the top right
corner of the screen Me.Top = 0
Me.Left = Screen.Width - Me.Width colorText = moBlack
colorMask = moWhite Set lyr = ActiveLayer
Set recs = lyr.Records Set tDesc = recs.TableDesc
Set flds = recs.Fields frmLayerSymbol.Caption = Symbol properties for the
UCaselyr.Name layer. strPanelDesc0 = The Single Symbol classification
displays all the features in a layer with the same symbol. strPanelDesc1 = The Unique Values classification
displays features by applying a symbol to each unique value for a specified field.
strPanelDesc2 = The Class Breaks classification applies symbols to a set of discrete values.
strPanelDesc3 = The Standard Labels classification draws text for a specified field.
strPanelDesc4 = The No Overlapping Labels classication draws text for a specified field and attempts to resolve
overlapping and crowding of labels. strPanelDesc5 = The Elevation classification draws
features according to their Z values, if the data supports it.
txtLayerName = lyr.Name
strMarkerStyle0 = Circle marker strMarkerStyle1 = Square marker
strMarkerStyle2 = Triangle marker strMarkerStyle3 = Cross marker
strMarkerStyle4 = TrueType marker strLineStyle0 = Solid line
strLineStyle1 = Dash line strLineStyle2 = Dot line
strLineStyle3 = Dash dot line strLineStyle4 = Dash dot dot line
strFillStyle0 = Solid fill strFillStyle1 = Transparent fill
strFillStyle2 = Horizontal fill strFillStyle3 = Vertical fill
strFillStyle4 = Upward diagonal strFillStyle5 = Downward diagonal
strFillStyle6 = Cross fill strFillStyle7 = Diagonal cross fill
strFillStyle8 = Light gray fill strFillStyle9 = Gray fill
strFillStyle10 = Dark gray fill justOpened = True
Read the contents of the active layers Renderer property.
Run one of the Load... procedures to populate the appropriate
tab with the current renderers properties. Select Case True
Case lyr.Renderer Is Nothing sstLayerProp.Tab = 0
Call LoadSingleSymbol Case TypeOf lyr.Renderer Is MapObjects2.ValueMapRenderer
sstLayerProp.Tab = 1 Call LoadUniqueValues
Case
TypeOf lyr.Renderer
Is MapObjects2.ClassBreaksRenderer
sstLayerProp.Tab = 2 Call LoadClassBreaks
Case TypeOf lyr.Renderer Is MapObjects2.LabelRenderer sstLayerProp.Tab = 3
Call LoadStandardLabels Case TypeOf lyr.Renderer Is MapObjects2.LabelPlacer
sstLayerProp.Tab = 4 colorMask = lyr.Renderer.MaskColor
Call LoadNoOverlapLabels Case TypeOf lyr.Renderer Is MapObjects2.ZRenderer
sstLayerProp.Tab = 5 Call LoadZRenderer
Case Else sstLayerProp.Tab = 0
Call LoadSingleSymbol
End Select If the active layer does not support Z shapes, disable
the Elevation rendering tab. If InStrlyr.Tag, [SHAPEFILZ] = 0 And InStrlyr.Tag,
[SDEZ] = 0 Then sstLayerProp.TabEnabled5 = False
End If Approximate factor to account for LabelPlacer text
placement margin compared to LabelRenderer.
lFactor = 0.9 End Sub
Private Sub cmdApply_Click When the user hits the Apply button or the OK button
read the option controls on the active tab, and use them to build a new renderer with which to draw the
layer. Select Case sstLayerProp.Tab
Case 0: Call ApplySingleSymbol Case 1: Call ApplyUniqueValues
Case 2: Call ApplyClassBreaks Case 3: Call ApplyStandardLabels
Case 4: Call ApplyNoOverlapLabels Case 5: Call ApplyZRenderer
End Select Rename the layer with the contents of txtLayerName.Text
lyr.Name = txtLayerName.Text Refresh the map legend
ParentForm.legend1.LoadLegend Redraw the map
ParentForm.Map1.Refresh End Sub
Private Sub cmdCancel_Click Throw away all work on this form.
Layer retains original rendering information. Unload frmLayerSymbol
End Sub Private Sub cmdOK_Click
Use Apply, then unload Call cmdApply_Click
Unload frmLayerSymbol End Sub
Private Sub cmdNOL_Click Choose font properties for the LabelPlacer
cdlgLayerProp.Color = colorText cdlgLayerProp.Flags = cdlCFEffects Or cdlCFBoth
cdlgLayerProp.ShowFont txtNOL.ForeColor = cdlgLayerProp.Color
txtNOL.Text = cdlgLayerProp.FontName colorText = cdlgLayerProp.Color
End Sub Private Sub cmdSL_Click
Choose font properties for the LabelRenderer cdlgLayerProp.Flags = cdlCFEffects Or cdlCFBoth
cdlgLayerProp.ShowFont txtSL.ForeColor = cdlgLayerProp.Color
txtSL.Text = cdlgLayerProp.FontName End Sub
Private Sub cmdCB_Click Build a new tentative class breaks legend
Call PopulateNewCBlegendcboCB0.Text cmdApply.Enabled = True
cmdOK.Enabled = True End Sub
Private Sub cmdUV_Click Build a new tentative unique values legend
Call PopulateNewUVlegendcboUV.Text cmdApply.Enabled = True
cmdOK.Enabled = True End Sub
Private Sub cmdZR_Click Build a new tentative Z elevation breaks legend
Call PopulateNewZRLegend cmdApply.Enabled = True
cmdOK.Enabled = True End Sub
Private Sub cboSSP_ClickIndex As Integer Dim fnt As New StdFont
Select Case Index Case 0 choose single symbol style
If Index = 0 Then If cboSSP0.Text = TrueType marker Then
Dim i As Integer cboSSP1.Enabled = True
cboSSP2.Enabled = True lblSSP3.Enabled = True
lblSSP4.Enabled = True lblSSP5.Enabled = True
lblSSP7.Enabled = True hsbSSP.Enabled = True
For i = 0 To Screen.FontCount - 1 cboSSP1.AddItem Screen.Fontsi
Next i cboSSP1.ListIndex = 0
fnt.Name = cboSSP1.Text Set cboSSP2.Font = fnt
cboSSP2.Clear For i = 0 To 255
cboSSP2.AddItem Chri Next
Else if not TT font, then disable controls specific to TT fonts
cboSSP1.Clear cboSSP2.Clear
cboSSP1.Enabled = False cboSSP2.Enabled = False
lblSSP3.Enabled = False lblSSP4.Enabled = False
lblSSP5.Enabled = False lblSSP7.Enabled = False
hsbSSP.Enabled = False End If
End If Case 1 populate combobox list of TT font glyphs in the
chosen font cboSSP2.Clear
fnt.Name = cboSSP1.Text Set cboSSP2.Font = fnt
For i = 0 To 255 cboSSP2.AddItem Chri
Next End Select
End Sub
Private Sub hsbSSP_Change Sets the rotation on a single symbol point marker
that is using a TT font lblSSP7.Caption = hsbSSP.Value
End Sub Private Sub hsbSL_Scroll
Sets the rotation on standard label text lblSL7.Caption = hsbSL.Value
End Sub Private Sub hsbSL_Change
Sets the rotation on standard label text lblSL7.Caption = hsbSL.Value
End Sub Private Sub picCBramp_ClickIndex As Integer
Sets start and stop ramp colors for class breaks renderer cdlgLayerProp.ShowColor
picCBrampIndex.BackColor = cdlgLayerProp.Color End Sub
Private Sub picNOL_Click User changes the MaskColor of the LabelPlacer
If colorMask moWhite Then cdlgLayerProp.Color = colorMask
End If cdlgLayerProp.ShowColor
picNOL.BackColor = cdlgLayerProp.Color colorMask = cdlgLayerProp.Color
Turn on the MaskLabels check box chkNOL2.Value = 1
End Sub Private Sub picSSP_ClickIndex As Integer
Sets the color for single symbol rendering cdlgLayerProp.ShowColor
picSSPIndex.BackColor = cdlgLayerProp.Color
End Sub Private Sub vsbUV_Change
If the legend preview is too large for its frame container, use the VSB to move it up
and down on demand. fraUVinner.Top = 200 - vsbUV.Value 200
End Sub Private Sub sstLayerProp_ClickPreviousTab As Integer
When the user clicks one of the renderer tabs, determine whether the active layer is already using that type of
renderer. Then... ...if it is, then read the properties of that layer and
use those properties to load the various option controls on that tab. Use one of the Load...
procedures. ...or if it is not, then load the various option
controls controls on that tab with some default values. Use
one of the Init... procedures. Dim lyrRend As Object
lblPanelDesc.Caption = strPanelDescsstLayerProp.Tab If lyr.Renderer Is Nothing Then Use of the Point
class here is arbitrary Set lyrRend = New MapObjects2.Point and only temporary
in use. VBs TypeOf Else keyword has
trouble with Nothing, which Set lyrRend = lyr.Renderer is what the
Layers Renderer property holds End If when drawing the
layer with a single symbol. If PreviousTab = 2 Then
If TypeOf lyrRend Is MapObjects2.ValueMapRenderer Then Exit Sub
End If End If
Select Case sstLayerProp.Tab Case 0
If TypeOf lyrRend Is MapObjects2.Point Then Call LoadSingleSymbol
Else Call InitSingleSymbol
End If Case 1
If TypeOf lyrRend Is MapObjects2.ValueMapRenderer Then Call LoadUniqueValues
Else Call InitUniqueValues
End If Case 2
If TypeOf lyrRend Is MapObjects2.ClassBreaksRenderer Then
Call LoadClassBreaks Else
Call InitClassBreaks End If
Case 3 If TypeOf lyrRend Is MapObjects2.LabelRenderer Then
Call LoadStandardLabels Else
Call InitStandardLabels End If
Case 4 If TypeOf lyrRend Is MapObjects2.LabelPlacer Then
Call LoadNoOverlapLabels Else
Call InitNoOverlapLabels End If
Case 5 If TypeOf lyrRend Is MapObjects2.ZRenderer Then
Call LoadZRenderer Else
Call InitZRenderer End If
End Select End Sub
THE SIX PROCEDURES THAT FOLLOW, THAT BEGIN WITH THE WORD INIT...
ARE THOSE THAT RUN WHEN A RENDERER IS CHOSEN WHICH DOES NOT COINCIDE WITH THE ACTIVE LAYERS CURRENT RENDERER. THE
OPTION CONTROLS ON THAT TAB ARE LOADED WITH DEFAULT VALUES THAT
THE USER CAN CHANGE.
InitSingleSymbol InitUniqueValues
InitClassBreaks InitStandardLabels
InitNoOverlapLabels InitZRenderer
Private Sub InitSingleSymbol Dim i As Integer
Dim fnt As New StdFont cboSSP0.Clear
Select Case lyr.shapeType Case moShapeTypePoint
set control visibility cboSSP1.Visible = True
cboSSP2.Visible = True chkSSP.Visible = False
hsbSSP.Visible = True picSSP1.Visible = False
lblSSP3.Visible = True lblSSP4.Visible = True
lblSSP5.Visible = True lblSSP6.Visible = False
lblSSP7.Visible = True retrieve and display current values
txtSSP0.Text = 5 lblSSP0.Caption = Marker Color:
lblSSP2.Caption = Size: For i = 0 To 4
cboSSP0.AddItem strMarkerStylei Next
picSSP0.BackColor = moGreen cboSSP0.Text = strMarkerStylemoSquareMarker
cboSSP0.ListIndex = 1 hsbSSP.Value = 0
lblSSP7.Caption = 0 cboSSP1.Enabled = False
cboSSP2.Enabled = False lblSSP3.Enabled = False
lblSSP4.Enabled = False lblSSP5.Enabled = False
lblSSP7.Enabled = False hsbSSP.Enabled = False
Case moShapeTypeMultipoint set control visibility
cboSSP1.Visible = True cboSSP2.Visible = True
chkSSP.Visible = False hsbSSP.Visible = True
picSSP1.Visible = False lblSSP3.Visible = True
lblSSP4.Visible = True lblSSP5.Visible = True
lblSSP6.Visible = False lblSSP7.Visible = True
retrieve and display current values txtSSP0.Text = 5
lblSSP0.Caption = Marker Color: lblSSP2.Caption = Size:
For i = 0 To 4 cboSSP0.AddItem strMarkerStylei
Next picSSP0.BackColor = moGreen
cboSSP0.Text = strMarkerStylemoSquareMarker cboSSP0.ListIndex = 1
hsbSSP.Value = 0 lblSSP7.Caption = 0
cboSSP1.Enabled = False cboSSP2.Enabled = False
lblSSP3.Enabled = False lblSSP4.Enabled = False
lblSSP5.Enabled = False lblSSP7.Enabled = False
hsbSSP.Enabled = False Case moLine
set visibility cboSSP1.Visible = False
cboSSP2.Visible = False chkSSP.Visible = False
hsbSSP.Visible = False picSSP1.Visible = False
lblSSP3.Visible = False lblSSP4.Visible = False
lblSSP5.Visible = False lblSSP6.Visible = False
lblSSP7.Visible = False retrieve and display current values
txtSSP0.Text = 1 lblSSP0.Caption = Line Color:
lblSSP2.Caption = Line width: For i = 0 To 4
cboSSP0.AddItem strLineStylei Next
picSSP0.BackColor = moBlue cboSSP0.Text = strLineStyle0
cboSSP0.ListIndex = 0 Case moPolygon
set visibility cboSSP1.Visible = False
cboSSP2.Visible = False chkSSP.Visible = True
hsbSSP.Visible = False picSSP1.Visible = True
lblSSP3.Visible = False lblSSP4.Visible = False
lblSSP5.Visible = False lblSSP6.Visible = True
lblSSP7.Visible = False retrieve and display current values
txtSSP0.Text = 1 lblSSP0.Caption = Fill Color:
lblSSP2.Caption = Outline width: For i = 0 To 10
cboSSP0.AddItem strFillStylei Next
picSSP0.BackColor = moLightGray picSSP1.BackColor = moBlack
cboSSP0.Text = strFillStyle0 cboSSP0.ListIndex = 0
chkSSP.Value = 1 End Select
cmdApply.Enabled = True cmdOK.Enabled = True
End Sub Private Sub InitUniqueValues
Dim i As Integer Load ComboBox with layer field names
cboUV.Clear For i = 0 To tDesc.FieldCount - 1
cboUV.AddItem tDesc.FieldNamei Next
cboUV.ListIndex = 0 fraUVouter.Caption = Legend Preview
If a legend already exists, unload it If picUV.Count 1 Then
For i = picUV.Count - 1 To 1 Step -1 Unload picUVi
Unload lblUVi Next
End If picUV0.Visible = False
lblUV0.Visible = False cmdApply.Enabled = False
cmdOK.Enabled = False chkUV.Visible = lyr.shapeType = moShapeTypePolygon
End Sub Private Sub InitClassBreaks
Dim i As Integer Dim fld As MapObjects2.Field
Clear and reload ComboBoxes cboCB0.Clear
cboCB0.AddItem FeatureID cboCB1.ListIndex = 3
For i = 0 To tDesc.FieldCount - 1 Set fld = fldstDesc.FieldNamei
If fld.Type = moDouble Or fld.Type = moLong Then cboCB0.AddItem fld.Name
End If Next
cboCB0.ListIndex = 0 If a legend already exists, unload it
If picCBlegend.Count 1 Then For i = picCBlegend.Count - 1 To 1 Step -1
Unload picCBlegendi Unload lblCBlegendi
Next End If
picCBlegend0.Visible = False lblCBlegend0.Visible = False
cmdApply.Enabled = False cmdOK.Enabled = False
chkCB.Visible = lyr.shapeType = moShapeTypePolygon End Sub
Private Sub InitStandardLabels Dim i As Integer
Dim sFirstStringFld As Integer, bFoundString As Boolean bFoundString = False
For i = 0 To tDesc.FieldCount - 1 cboSL0.AddItem tDesc.FieldNamei
If tDesc.FieldTypei = moLong Or _ tDesc.FieldTypei = moDouble Then
cboSL3.AddItem tDesc.FieldNamei cboSL4.AddItem tDesc.FieldNamei
ElseIf Not bFoundString And tDesc.FieldTypei = moString Then
sFirstStringFld = i bFoundString = True
End If Next
cboSL0.ListIndex = sFirstStringFld cboSL1.ListIndex = 1
cboSL2.ListIndex = 1 cdlgLayerProp.FontName = MS Sans Serif
cdlgLayerProp.FontSize = 10 cdlgLayerProp.FontBold = False
cdlgLayerProp.FontItalic = False
cdlgLayerProp.FontStrikethru = False cdlgLayerProp.FontUnderline = False
cdlgLayerProp.Color = moBlack cmdApply.Enabled = True
cmdOK.Enabled = True This function may be called if the layer currently has a
LabelPlacer set. If Not lyr.Renderer Is Nothing Then
If TypeOf lyr.Renderer Is MapObjects2.LabelPlacer Then Work out scale based on layers extent. This value
will be used to help convert the slider height value into a label
size in map units.
Dim scaleHeightUnit As Double scaleHeightUnit = lyr.Extent.Width 10000
Use size from existing LabelPlacer. Dim currSizeMapUnits As Double
currSizeMapUnits = lyr.Renderer.DefaultSymbol.Height Convert this Map Units size to a size in Points
size, and set the Font size value appropriately.
Dim sglTemp As Single sglTemp
= ParentForm.Map1.FromMapDistancecurrSizeMapUnits 1
lFactor Dim currSizePoints As Double
currSizePoints = ScaleYsglTemp, vbTwips, vbPoints cdlgLayerProp.FontSize = currSizePoints
Copy other values if appropriate. cboSL0.Text = lyr.Renderer.Field
End If End If
End Sub Private Sub InitNoOverlapLabels
Dim i As Integer cboNOL.Clear
Dim sFirstStringFld As Integer, bFoundString As Boolean bFoundString = False
For i = 0 To tDesc.FieldCount - 1 cboNOL.AddItem tDesc.FieldNamei
If
Not bFoundString
And tDesc.FieldTypei
= moString Then
sFirstStringFld = i
bFoundString = True End If
Next cboNOL.ListIndex = sFirstStringFld
cdlgLayerProp.FontName = MS Sans Serif cdlgLayerProp.FontSize = 10
cdlgLayerProp.FontBold = False cdlgLayerProp.FontItalic = False
cdlgLayerProp.FontStrikethru = False cdlgLayerProp.FontUnderline = False
cdlgLayerProp.Color = moBlack cmdApply.Enabled = True
cmdOK.Enabled = True fraNOL0.Enabled = lyr.shapeType moShapeTypePolygon
For i = 0 To optNOL.Count - 1 optNOLi.Enabled
= lyr.shapeType
moShapeTypePolygon Next
This function may be called if the layer currently has a LabelRenderer set. Approximate the size of the existing
label size Font points into Map units.
If Not lyr.Renderer Is Nothing Then If TypeOf lyr.Renderer Is MapObjects2.LabelRenderer Then
Work out scale based on layers extent. This value will be used
to help convert the slider height value into a label size in
map units. Dim scaleHeightUnit As Double
scaleHeightUnit = lyr.Extent.Width 10000 Use size from existing LabelRenderer - need to work
out an equivalent size in Map Units from this font size.
Dim currSizeFontPoints As Double currSizeFontPoints
= CIntlyr.Renderer.Symbol0.Font.Size
Have a current LabelRenderer Symbol Font Size - in points.
convert this points size to a MapUnits size, and set the slider
value appropriately. Dim sglTemp As Single
sglTemp = ScaleXCSngcurrSizeFontPoints, vbPoints, vbTwips
Dim currSizeMapUnits As Double
currSizeMapUnits =
ParentForm.Map1.ToMapDistancesglTemp lFactor hsbNOL.Value
= 1000
- currSizeMapUnits
scaleHeightUnit Copy other values if appropriate.
cboNOL.Text = lyr.Renderer.Field End If
End If End Sub
Public Sub InitZRenderer Dim i As Integer
If picZRlegend.Count 1 Then For i = picZRlegend.Count - 1 To 1 Step -1
Unload picZRlegendi Unload lblZRlegendi
Next End If
picZRlegend0.Visible = False lblZRlegend0.Visible = False
cmdApply.Enabled = False cmdOK.Enabled = False
End Sub THE SIX PROCEDURES THAT FOLLOW, THAT BEGIN WITH THE WORD
LOAD... ARE THOSE THAT RUN WHEN A RENDERER IS CHOSEN WHICH
COINCIDES WITH THE ACTIVE LAYERS CURRENT RENDERER. THE PROPERTIES
OF THAT RENDERER ARE LOADED INTO THE OPTION CONTROLS ON THAT
RENDERERS FORM. THE USER CAN CHANGE THEM AT THAT POINT. LoadSingleSymbol
LoadUniqueValues LoadClassBreaks
LoadStandardLabels LoadNoOverlapLabels
LoadZRenderer Private Sub LoadSingleSymbol
Dim i As Integer
Dim fnt As New StdFont cboSSP0.Clear
Select Case lyr.shapeType Case moShapeTypePoint
set control visibility cboSSP1.Visible = True
cboSSP2.Visible = True chkSSP.Visible = False
hsbSSP.Visible = True picSSP1.Visible = False
lblSSP3.Visible = True lblSSP4.Visible = True
lblSSP5.Visible = True lblSSP6.Visible = False
lblSSP7.Visible = True retrieve and display current values
txtSSP0.Text = lyr.Symbol.Size lblSSP0.Caption = Marker Color:
lblSSP2.Caption = Size: For i = 0 To 4
cboSSP0.AddItem strMarkerStylei Next
picSSP0.BackColor = lyr.Symbol.Color cboSSP0.Text = strMarkerStylelyr.Symbol.Style
cboSSP0.ListIndex = lyr.Symbol.Style hsbSSP.Value = lyr.Symbol.Rotation
lblSSP7.Caption = lyr.Symbol.Rotation If lyr.Symbol.Style = moTrueTypeMarker Then
cboSSP1.Enabled = True cboSSP2.Enabled = True
lblSSP3.Enabled = True lblSSP4.Enabled = True
lblSSP5.Enabled = True lblSSP7.Enabled = True
hsbSSP.Enabled = True For i = 0 To Screen.FontCount - 1
cboSSP1.AddItem Screen.Fontsi Next i
cboSSP1.Text = lyr.Symbol.Font.Name For i = 0 To cboSSP1.ListCount - 1
If
cboSSP1.ListcboSSP1.ListIndex =
cboSSP1.Text Then cboSSP1.ListIndex = 1
Exit For End If
Next fnt.Name = cboSSP1.Text
Set cboSSP2.Font = fnt cboSSP2.Clear
For i = 0 To 255 cboSSP2.AddItem Chri
Next
cboSSP2.Text = lyr.Symbol.CharacterIndex cboSSP2.ListIndex = lyr.Symbol.CharacterIndex
End If Case moShapeTypeMultipoint
set control visibility cboSSP1.Visible = True
cboSSP2.Visible = True chkSSP.Visible = False
hsbSSP.Visible = True picSSP1.Visible = False
lblSSP3.Visible = True lblSSP4.Visible = True
lblSSP5.Visible = True lblSSP6.Visible = False
lblSSP7.Visible = True retrieve and display current values
txtSSP0.Text = lyr.Symbol.Size lblSSP0.Caption = Marker Color:
lblSSP2.Caption = Size: For i = 0 To 4
cboSSP0.AddItem strMarkerStylei Next
picSSP0.BackColor = lyr.Symbol.Color cboSSP0.Text = strMarkerStylelyr.Symbol.Style
cboSSP0.ListIndex = lyr.Symbol.Style hsbSSP.Value = lyr.Symbol.Rotation
lblSSP7.Caption = lyr.Symbol.Rotation If lyr.Symbol.Style = moTrueTypeMarker Then
cboSSP1.Enabled = True cboSSP2.Enabled = True
lblSSP3.Enabled = True lblSSP4.Enabled = True
lblSSP5.Enabled = True lblSSP7.Enabled = True
hsbSSP.Enabled = True For i = 0 To Screen.FontCount - 1
cboSSP1.AddItem Screen.Fontsi Next i
cboSSP1.Text = lyr.Symbol.Font.Name For i = 0 To cboSSP1.ListCount - 1
If
cboSSP1.ListcboSSP1.ListIndex =
cboSSP1.Text Then cboSSP1.ListIndex = 1
Exit For End If
Next fnt.Name = cboSSP1.Text
Set cboSSP2.Font = fnt cboSSP2.Clear
For i = 0 To 255 cboSSP2.AddItem Chri
Next
cboSSP2.Text = lyr.Symbol.CharacterIndex cboSSP2.ListIndex = lyr.Symbol.CharacterIndex
End If Case moShapeTypeLine
set visibility cboSSP1.Visible = False
cboSSP2.Visible = False chkSSP.Visible = False
hsbSSP.Visible = False picSSP1.Visible = False
lblSSP3.Visible = False lblSSP4.Visible = False
lblSSP5.Visible = False lblSSP6.Visible = False
lblSSP7.Visible = False retrieve and display current values
txtSSP0.Text = lyr.Symbol.Size lblSSP0.Caption = Line Color:
lblSSP2.Caption = Line width: For i = 0 To 4
cboSSP0.AddItem strLineStylei Next
picSSP0.BackColor = lyr.Symbol.Color cboSSP0.Text = strLineStylelyr.Symbol.Style
cboSSP0.ListIndex = lyr.Symbol.Style Case moShapeTypePolygon
set visibility cboSSP1.Visible = False
cboSSP2.Visible = False chkSSP.Visible = True
hsbSSP.Visible = False picSSP1.Visible = True
lblSSP3.Visible = False lblSSP4.Visible = False
lblSSP5.Visible = False lblSSP6.Visible = True
lblSSP7.Visible = False retrieve and display current values
If lyr.Symbol.Size = 0 Then txtSSP0.Text = 1
Else txtSSP0.Text = lyr.Symbol.Size
End If lblSSP0.Caption = Fill Color:
lblSSP2.Caption = Outline width: For i = 0 To 10
cboSSP0.AddItem strFillStylei Next
picSSP0.BackColor = lyr.Symbol.Color picSSP1.BackColor = lyr.Symbol.OutlineColor
cboSSP0.Text = strFillStylelyr.Symbol.Style cboSSP0.ListIndex = lyr.Symbol.Style
Select Case lyr.Symbol.Outline Case True: chkSSP.Value = 1
Case False: chkSSP.Value = 0 End Select
End Select End Sub
Private Sub LoadUniqueValues Dim i As Integer
Set vmr = lyr.Renderer cboUV.Clear
cboUV.Text = vmr.Field For i = 0 To tDesc.FieldCount - 1
cboUV.AddItem tDesc.FieldNamei If tDesc.FieldNamei = vmr.Field Then
cboUV.ListIndex = i End If
Next Select Case vmr.Symbol0.Outline
Case True: chkUV.Value = 1 Case False: chkUV.Value = 0
End Select chkUV.Visible = lyr.shapeType = moShapeTypePolygon
Call PopulateExistingUVlegend End Sub
Private Sub LoadClassBreaks Dim i, j As Integer
Set cbr = lyr.Renderer j = -1
cboCB0.Clear cboCB0.Text = cbr.Field
For i = 0 To tDesc.FieldCount - 1 If tDesc.FieldTypei = moDouble Or _
tDesc.FieldTypei = moLong Then j = j + 1
cboCB0.AddItem tDesc.FieldNamei If tDesc.FieldNamei = cbr.Field Then
cboCB0.ListIndex = j End If
End If Next
cboCB1.Text = cbr.BreakCount + 1 cboCB1.ListIndex = cbr.BreakCount - 1
Select Case cbr.Symbol0.Outline Case True
chkCB.Value = 1 Case False
chkCB.Value = 0 End Select
picCBramp0.BackColor = cbr.Symbol0.Color picCBramp1.BackColor = cbr.Symbolcbr.BreakCount.Color
chkCB.Visible = lyr.shapeType = moShapeTypePolygon Call PopulateExistingCBlegend
End Sub Private Sub LoadStandardLabels
Dim i As Integer Dim strFN As String
Set lr = lyr.Renderer For i = 0 To tDesc.FieldCount - 1
strFN = tDesc.FieldNamei cboSL0.AddItem strFN
If lr.Field = strFN Then cboSL0.ListIndex = i
End If If tDesc.FieldTypei = moLong Or _
tDesc.FieldTypei = moDouble Then cboSL3.AddItem strFN
If lr.XOffsetField = strFN Then cboSL3.ListIndex = i
End If cboSL4.AddItem strFN
If lr.YOffsetField = strFN Then cboSL4.ListIndex = i
End If End If
Next Select Case lr.Symbol0.HorizontalAlignment
Case moAlignLeft cboSL1.ListIndex = 0
Case moAlignCenter cboSL1.ListIndex = 1
Case moAlignRight cboSL1.ListIndex = 2
End Select Select Case lr.Symbol0.VerticalAlignment
Case moAlignTop cboSL2.ListIndex = 0
Case moAlignCenter cboSL2.ListIndex = 1
Case moAlignBottom cboSL2.ListIndex = 2
End Select hsbSL.Value = lr.Symbol0.Rotation
lblSL7.Caption = lr.Symbol0.Rotation For i = 0 To 3
chkSLi.Value = 0 Next
If lr.DrawBackground Then chkSL0.Value = 1
End If If lr.AllowDuplicates Then
chkSL1.Value = 1 End If
If lr.SplinedText Then chkSL2.Value = 1
End If If lr.Flip Then
chkSL3.Value = 1 End If
txtSL.Text = lr.Symbol0.Font.Name txtSL.ForeColor = lr.Symbol0.Color
cdlgLayerProp.FontName = lr.Symbol0.Font.Name cdlgLayerProp.FontSize = lr.Symbol0.Font.Size
cdlgLayerProp.FontBold = lr.Symbol0.Font.Bold cdlgLayerProp.FontItalic = lr.Symbol0.Font.Italic
cdlgLayerProp.FontStrikethru
= lr.Symbol0.Font.Strikethrough
cdlgLayerProp.FontUnderline = lr.Symbol0.Font.Underline cdlgLayerProp.Color = lr.Symbol0.Color
End Sub Private Sub LoadNoOverlapLabels
Dim i As Integer Dim scaleHeightUnit As Double
Dim strFN As String Set lp = lyr.Renderer
colorMask = lp.MaskColor cboNOL.Clear
For i = 0 To tDesc.FieldCount - 1 strFN = tDesc.FieldNamei
cboNOL.AddItem strFN If lp.Field = strFN Then
cboNOL.ListIndex = i End If
Next cdlgLayerProp.FontName = lp.DefaultSymbol.Font.Name
cdlgLayerProp.FontSize = lp.DefaultSymbol.Font.Size cdlgLayerProp.FontBold = lp.DefaultSymbol.Font.Bold
cdlgLayerProp.FontItalic = lp.DefaultSymbol.Font.Italic cdlgLayerProp.FontStrikethru
= lp.DefaultSymbol.Font.Strikethrough
cdlgLayerProp.FontUnderline =
lp.DefaultSymbol.Font.Underline colorText = lp.DefaultSymbol.Color
txtNOL.Text = lp.DefaultSymbol.Font.Name txtNOL.ForeColor = colorText
optNOL0.Value = lp.PlaceOn optNOL1.Value = lp.PlaceAbove
optNOL2.Value = lp.PlaceBelow Select Case lp.DrawBackground
Case False: chkNOL0.Value = 0 Case True: chkNOL0.Value = 1
End Select Select Case lp.AllowDuplicates
Case False: chkNOL1.Value = 0 Case True: chkNOL1.Value = 1
End Select Select Case lp.MaskLabels
Case False: chkNOL2.Value = 0 Case True
chkNOL2.Value = 1 picNOL.BackColor = lp.MaskColor
End Select scaleHeightUnit = lyr.Extent.Width 10000
scaleHeightUnit
= frmMain.mapDisp.FullExtent.Width
10000 hsbNOL.Value
= 1000
- lp.DefaultSymbol.Height
scaleHeightUnit hsbNOL.Value
= 700
- lp.DefaultSymbol.Height
scaleHeightUnit End Sub
Private Sub LoadZRenderer Dim i, j As Integer
Set zRend = lyr.Renderer j = -1
cboZRclasses.Clear cboZRclasses.Text = zRend.BreakCount + 1
cboZRType.ListIndex = zRend.ValueCalculation picZRramp0.BackColor = zRend.Symbol0.Color
picZRramp1.BackColor
= zRend.SymbolzRend.BreakCount.Color
Call PopulateExistingZRlegend End Sub
THE SIX PROCEDURES THAT FOLLOW, THAT BEGIN WITH THE WORD APPLY...
ARE THOSE THAT RUN WHEN THE APPLY OR OK BUTTONS ARE CLICKED.
THE CURRENT VALUES OF THE OPTION CONTROLS ARE READ, WRITTEN INTO A NEW RENDERER OBJECT. THEN THAT RENDERER OBJECT IS
USED TO DRAW THE ACTIVE LAYER. ApplySingleSymbol
ApplyUniqueValues ApplyClassBreaks
ApplyStandardLabels ApplyNoOverlapLabels
ApplyZRenderer Private Sub ApplySingleSymbol
Dim sym As MapObjects2.Symbol Set sym = lyr.Symbol
lyr.Name = txtLayerName.Text Set lyr.Renderer = Nothing
Select Case lyr.shapeType Case moShapeTypePoint
sym.Color = picSSP0.BackColor sym.Style = cboSSP0.ListIndex
If hsbSSP.Value = 0 Then sym.Rotation = 0
Else Clockwise instead of the default counter-clockwise
sym.Rotation = 360 - hsbSSP.Value End If
If IsNumerictxtSSP0.Text Then sym.Size = txtSSP0.Text
Else sym.Size = 5
End If If sym.Style = moTrueTypeMarker Then
Dim fnt As New StdFont fnt.Name = cboSSP1.Text
Set sym.Font = fnt a = AsccboSSP2.Text
sym.CharacterIndex = AsccboSSP2.Text End If
Case moShapeTypeMultipoint
sym.Color = picSSP0.BackColor sym.Style = cboSSP0.ListIndex
If hsbSSP.Value = 0 Then sym.Rotation = 0
Else Clockwise instead of the default counter-clockwise
sym.Rotation = 360 - hsbSSP.Value End If
If IsNumerictxtSSP0.Text Then sym.Size = txtSSP0.Text
Else sym.Size = 5
End If If sym.Style = moTrueTypeMarker Then
Dim fnt2 As New StdFont fnt2.Name = cboSSP1.Text
Set sym.Font = fnt2 a = AsccboSSP2.Text
sym.CharacterIndex = AsccboSSP2.Text End If
Case moLine sym.Color = picSSP0.BackColor
sym.Style = cboSSP0.ListIndex If IsNumerictxtSSP0.Text Then
sym.Size = txtSSP0.Text Else
sym.Size = 1 End If
Case moPolygon sym.Color = picSSP0.BackColor
sym.OutlineColor = picSSP1.BackColor sym.Style = cboSSP0.ListIndex
If IsNumerictxtSSP0.Text Then sym.Size = txtSSP0.Text
Else sym.Size = 1
End If Select Case chkSSP.Value
Case 1 lyr.Symbol.Outline = True
Case 0 lyr.Symbol.OutlineColor = lyr.Symbol.Color
lyr.Symbol.Outline = False End Select
End Select End Sub
Private Sub ApplyUniqueValues Dim i As Integer
Dim symInt As Integer
If lyr.shapeType = moShapeTypeMultipoint Then symInt = 0
Else symInt = lyr.shapeType - 21
End If vmr.SymbolType = symInt
If vmr.SymbolType = moFillSymbol Then For i = 0 To vmr.ValueCount - 1
Select Case chkUV.Value Case 0
vmr.Symboli.Outline = False vmr.Symboli.OutlineColor = vmr.Symboli.Color
Case 1 vmr.Symboli.Outline = True
vmr.Symboli.OutlineColor = moBlack End Select
Next End If
Set lyr.Renderer = vmr End Sub
Private Sub ApplyClassBreaks Dim i As Integer
Dim symInt As Integer If lyr.shapeType = moShapeTypeMultipoint Then
symInt = 0 Else
symInt = lyr.shapeType - 21 End If
cbr.SymbolType = symInt If cbr.SymbolType = moFillSymbol Then
For i = 0 To cbr.BreakCount Select Case chkCB.Value
Case 0 cbr.Symboli.OutlineColor = cbr.Symboli.Color
cbr.Symboli.Outline = False Case 1
cbr.Symboli.OutlineColor = moBlack cbr.Symboli.Outline = True
End Select Next
End If Set lyr.Renderer = cbr
End Sub
Private Sub ApplyStandardLabels Dim fnt As New StdOle.StdFont
fnt.Name = cdlgLayerProp.FontName fnt.Size = cdlgLayerProp.FontSize
fnt.Bold = cdlgLayerProp.FontBold fnt.Italic = cdlgLayerProp.FontItalic
fnt.Strikethrough = cdlgLayerProp.FontStrikethru fnt.Underline = cdlgLayerProp.FontUnderline
Set lr = New MapObjects2.LabelRenderer lr.Field = cboSL0.Text
With lr.Symbol0 Select Case cboSL1.Text
Case Left .HorizontalAlignment = moAlignLeft
Case Center .HorizontalAlignment = moAlignCenter
Case Right .HorizontalAlignment = moAlignRight
End Select Select Case cboSL2.Text
Case Top .VerticalAlignment = moAlignTop
Case Center .VerticalAlignment = moAlignCenter
Case Bottom .VerticalAlignment = moAlignBottom
End Select Set .Font = fnt
.Color = cdlgLayerProp.Color Rotate clockwise instead of counter-clockwise
If lblSL7.Caption = 0 Then .Rotation = 0
Else .Rotation = 360 - lblSL7.Caption
End If End With
With lr .XOffsetField = cboSL3.Text
.YOffsetField = cboSL4.Text .DrawBackground = chkSL0.Value = 1
.AllowDuplicates = chkSL1.Value = 1 .SplinedText = chkSL2.Value = 1
.Flip = chkSL3.Value = 1 End With
Set lyr.Renderer = lr End Sub
Private Sub ApplyNoOverlapLabels Dim fnt As New StdOle.StdFont
Set lp = New MapObjects2.LabelPlacer lp.Field = cboNOL.Text
fnt.Name = cdlgLayerProp.FontName fnt.Bold = cdlgLayerProp.FontBold
fnt.Italic = cdlgLayerProp.FontItalic fnt.Strikethrough = cdlgLayerProp.FontStrikethru
fnt.Underline = cdlgLayerProp.FontUnderline Dim scaleHeightUnit As Double
scaleHeightUnit = lyr.Extent.Width 10000 With lp.DefaultSymbol
.Height = scaleHeightUnit 1001 - hsbNOL.Value .Color = colorText
Set .Font = fnt End With
lp.PlaceAbove = optNOL1 lp.PlaceBelow = optNOL2
lp.PlaceOn = optNOL0 Select Case chkNOL0.Value
Case 0: lp.DrawBackground = False Case 1: lp.DrawBackground = True
End Select Select Case chkNOL1.Value
Case 0: lp.AllowDuplicates = False Case 1: lp.AllowDuplicates = True
End Select Select Case chkNOL2.Value
Case 0: lp.MaskLabels = False Case 1
lp.MaskLabels = True lp.MaskColor = picNOL.BackColor
End Select Set lyr.Renderer = lp
End Sub Private Sub ApplyZRenderer
Dim symInt As Integer If lyr.shapeType = moShapeTypeMultipoint Then
symInt = 0 Else
symInt = lyr.shapeType - 21 End If
zRend.SymbolType = symInt Set lyr.Renderer = zRend
End Sub THE NEXT SIX PROCEDURES THAT START WITH THE WORD
POPULATE... ARE THOSE THAT RUN WHEN ONE OF THE RESET LEGEND BUTTONS
ARE PRESSED. THESE PROCEDURES CALCULATE AND LOAD A LEGEND PREVIEW ON THE LAYERSYMBOL FORM THAT THE USER CAN EXAMINE
BEFORE APPLYING TO THE MAP. PopulateNewUVLegend, PopulateExistingUVLegend unique
values PopulateNewCBLegend, PopulateExistingCBLegend class
breaks PopulateNewZRLegend, PopulateExistingZRLegend elevation
Z values Private Sub PopulateNewUVlegendrendField As String
Dim strsUniqueValues As New MapObjects2.Strings Dim fld As MapObjects2.Field
Dim i As Integer Set fld = fldsrendField
If fld Is Nothing Then Exit Sub
End If Screen.MousePointer = vbHourglass
recs.MoveFirst Do While Not recs.EOF
strsUniqueValues.Add fld.Value recs.MoveNext
Loop Screen.MousePointer = vbDefault
If strsUniqueValues.Count 100 Then Dim yn As Integer
yn = MsgBoxNumber of unique values is greater than 100. Would you like to continue?, _
vbYesNo, Unique values If yn = 7 Then
Exit Sub End If
End If If picUV.Count 1 Then
For i = picUV.Count - 1 To 1 Step -1 Unload picUVi
Unload lblUVi Next
End If Set vmr = New MapObjects2.ValueMapRenderer
vmr.Field = rendField vmr.ValueCount = strsUniqueValues.Count
For i = 0 To strsUniqueValues.Count - 1 vmr.Valuei = strsUniqueValuesi
Next fraUVouter.Caption = UCaselyr.Name - cboUV.Text
picUV0.Visible = True lblUV0.Visible = True
picUV0.BackColor = vmr.Symbol0.Color lblUV0.Caption = vmr.Value0
For i = 1 To vmr.ValueCount - 1 Load picUVi
With picUVi .Left = picUV0.Left
.Width = picUV0.Width .Height = picUV0.Height
.Top = picUVi - 1.Top + 180 .BackColor = vmr.Symboli.Color
.Visible = True End With
Load lblUVi With lblUVi
.Left = lblUV0.Left .Width = lblUV0.Width
.Height = lblUV0.Height .Top = lblUVi - 1.Top + 180
.Caption = vmr.Valuei .Visible = True
End With Next
fraUVinner.Height = vmr.ValueCount 180 + 250 If strsUniqueValues.Count 18 Then
vsbUV.Enabled = True vsbUV.Min = 0
vsbUV.Max = vmr.ValueCount - 20 vsbUV.SmallChange = 1
vsbUV.LargeChange = 10 Else
vsbUV.Enabled = False
End If End Sub
Private Sub PopulateExistingUVlegend If Not justOpened Then
Exit Sub End If
Dim recs As MapObjects2.Recordset Dim fld As MapObjects2.Field
Dim i As Integer Set vmr = lyr.Renderer
If picUV.Count 1 Then For i = picUV.Count - 1 To 1 Step -1
Unload picUVi Unload lblUVi
Next End If
fraUVouter.Caption
= UCaselyr.Name
- lyr.Renderer.Field
picUV0.Visible = True lblUV0.Visible = True
picUV0.BackColor = vmr.Symbol0.Color lblUV0.Caption = vmr.Value0
For i = 1 To vmr.ValueCount - 1 Load picUVi
With picUVi .Left = picUV0.Left
.Width = picUV0.Width .Height = picUV0.Height
.Top = picUVi - 1.Top + 180 .BackColor = vmr.Symboli.Color
.Visible = True End With
Load lblUVi With lblUVi
.Left = lblUV0.Left .Width = lblUV0.Width
.Height = lblUV0.Height .Top = lblUVi - 1.Top + 180
.Caption = vmr.Valuei .Visible = True
End With Next
fraUVinner.Height = vmr.ValueCount 180 + 300
If vmr.ValueCount 18 Then vsbUV.Enabled = True
vsbUV.Min = 0 vsbUV.Max = vmr.ValueCount - 20
vsbUV.SmallChange = 1 vsbUV.LargeChange = 10
Else vsbUV.Enabled = False
End If justOpened = False
End Sub Private Sub PopulateNewCBlegendrendField As String
Dim stats As MapObjects2.Statistics Dim range As Double
Dim i, numClasses, numBreaks As Integer If TrimcboCB0.Text = vbNullString Then
cboCB0.ListIndex = 0 End If
Set stats = recs.CalculateStatisticscboCB0.Text numClasses = cboCB1.Text
numBreaks = numClasses - 1 If picCBlegend.Count 1 Then
For i = picCBlegend.Count - 1 To 1 Step -1 Unload picCBlegendi
Unload lblCBlegendi Next
End If Set cbr = New MapObjects2.ClassBreaksRenderer
cbr.Field = cboCB0.Text cbr.BreakCount = numBreaks
range = stats.Max - stats.Min For i = 0 To numBreaks - 1
cbr.Breaki = stats.Min + range numClasses i + 1
Next cbr.RampColors
picCBramp0.BackColor, picCBramp1.BackColor
fraCB.Caption = UCaselyr.Name - cboCB0.Text picCBlegend0.Visible = True
lblCBlegend0.Visible = True picCBlegend0.BackColor = cbr.Symbol0.Color
lblCBlegend0.Caption =
Less than
Formatcbr.Break0, 0.00 For i = 1 To cbr.BreakCount
Load picCBlegendi With picCBlegendi
.Left = picCBlegend0.Left .Width = picCBlegend0.Width
.Height = picCBlegend0.Height .Top = picCBlegendi - 1.Top + 180
.BackColor = cbr.Symboli.Color .Visible = True
End With Load lblCBlegendi
With lblCBlegendi .Left = lblCBlegend0.Left
.Width = lblCBlegend0.Width .Height = lblCBlegend0.Height
.Top = lblCBlegendi - 1.Top + 180 .Visible = True
Select Case i Case cbr.BreakCount
.Caption = = Formatcbr.Breakcbr.BreakCount - 1, 0.00
Case Else .Caption = Formatcbr.Breaki - 1, 0.00 -
Formatcbr.Breaki, 0.00 End Select
End With Next
End Sub Public Sub PopulateExistingCBlegend
If Not justOpened Then Exit Sub
End If Dim stats As MapObjects2.Statistics
Dim i, numClasses, numBreaks As Integer Set stats = recs.CalculateStatisticslyr.Renderer.Field
numBreaks = lyr.Renderer.BreakCount If picCBlegend.Count 1 Then
For i = picCBlegend.Count - 1 To 1 Step -1 Unload picCBlegendi
Unload lblCBlegendi Next
End If
Set cbr = lyr.Renderer cbr.Field = lyr.Renderer.Field
fraCB.Caption = UCaselyr.Name - cboCB0.Text picCBlegend0.Visible = True
lblCBlegend0.Visible = True picCBlegend0.BackColor = cbr.Symbol0.Color
lblCBlegend0.Caption
= Less
than Formatcbr.Break0, 0.00
For i = 1 To cbr.BreakCount Load picCBlegendi
With picCBlegendi .Left = picCBlegend0.Left
.Width = picCBlegend0.Width .Height = picCBlegend0.Height
.Top = picCBlegendi - 1.Top + 180 .BackColor = cbr.Symboli.Color
.Visible = True End With
Load lblCBlegendi With lblCBlegendi
.Left = lblCBlegend0.Left .Width = lblCBlegend0.Width
.Height = lblCBlegend0.Height .Top = lblCBlegendi - 1.Top + 180
.Visible = True Select Case i
Case cbr.BreakCount .Caption = = Formatstats.Max, 0.00
Case Else .Caption = Formatcbr.Breaki - 1, 0.00 -
Formatcbr.Breaki, 0.00 End Select
End With Next
justOpened = False End Sub
Private Sub PopulateNewZRLegend Dim n As Integer
Dim range As Double Dim MinZ As Double, MaxZ As Double
MinZ = lyr.Extent.Floor MaxZ = lyr.Extent.Ceiling
MaxZ = 1400 range = MaxZ - MinZ
clear existing legend If picZRlegend.Count 1 Then
For n = picZRlegend.Count - 1 To 1 Step -1 Unload picZRlegendn
Unload lblZRlegendn Next
End If set new breakcount
Set zRend = New MapObjects2.ZRenderer zRend.BreakCount
= cboZRclasses.ListcboZRclasses.ListIndex - 1
Set the breaks using simple equal interval ranges... For n = 1 To zRend.BreakCount
zRend.Breakn - 1 = MinZ + range zRend.BreakCount + 1 n
Next n Build symbol array by ramping start and end colors
zRend.RampColors
picZRramp0.BackColor, picZRramp1.BackColor
handle the base items in the object arrays picZRlegend0.BackColor = picZRramp0.BackColor
lblZRlegend0.Caption
= Less
Than FormatzRend.Break0, 0.00
picZRlegend0.Visible = True lblZRlegend0.Visible = True
For n = 1 To zRend.BreakCount Set up the color boxes
Load picZRlegendn With picZRlegendn
.Top = picZRlegendn - 1.Top + 180 .BackColor = zRend.Symboln.Color
.Visible = True End With
Set up the labels Load lblZRlegendn
With lblZRlegendn .Top = lblZRlegendn - 1.Top + 180
.Visible = True Select Case n
Case zRend.BreakCount .Caption = Greater Than FormatzRend.Breakn
- 1, 0.00 Case Else
.Caption = FormatzRend.Breakn - 1, 0.00 - FormatzRend.Breakn, 0.00
End Select End With
Next n End Sub
Private Sub PopulateExistingZRlegend If Not justOpened Then
Exit Sub End If
Dim stats As MapObjects2.Statistics Dim i, numClasses, numBreaks As Integer
Set zRend = lyr.Renderer If picZRlegend.Count 1 Then
For i = picZRlegend.Count - 1 To 1 Step -1 Unload picZRlegendi
Unload lblZRlegendi Next
End If picZRlegend0.Visible = True
lblZRlegend0.Visible = True picZRlegend0.BackColor = zRend.Symbol0.Color
lblZRlegend0.Caption
= Less
than FormatzRend.Break0, 0.00
For i = 1 To zRend.BreakCount Load picZRlegendi
With picZRlegendi .Left = picZRlegend0.Left
.Width = picZRlegend0.Width .Height = picZRlegend0.Height
.Top = picZRlegendi - 1.Top + 180 .BackColor = zRend.Symboli.Color
.Visible = True End With
Load lblZRlegendi With lblZRlegendi
.Left = lblZRlegend0.Left .Width = lblZRlegend0.Width
.Height = lblZRlegend0.Height .Top = lblZRlegendi - 1.Top + 180
.Visible = True Select Case i
Case zRend.BreakCount .Caption = = Formatstats.Max, 0.00
Case Else .Caption = FormatzRend.Breaki - 1, 0.00
- FormatzRend.Breaki, 0.00 End Select
End With Next
justOpened = False End Sub
Form Add Line Jalur
Public PointFrom As String Public PointTo As String
Public Distance As Single Private Sub cmdCancel_Click
Unload Me End Sub
Private Sub cmdOK_Click SaveLine
Unload Me End Sub
Private Sub Form_Load
FillCombo cboPointFrom, SELECT PointName FROM Points ORDER BY PointName
FillCombo cboPointTo, SELECT PointName FROM Points ORDER BY PointName
cboPointFrom.Text = PointFrom cboPointTo.Text = PointTo
txtWeightDistance.Text = Distance End Sub
Private Sub SaveLine Dim SQL As String
On Error GoTo ErrHandler SQL
= INSERT
INTO LinesPointFrom,
PointTo, WeightDistance, WeightTime, WeightCost, _
Width, Condition,
Density, FixedCost,
VariableCost, MaxVehicleSize, MaxVehicleSpeed _ VALUES cboPointFrom.Text ,
cboPointTo.Text , _ ValtxtWeightDistance.Text
, ValtxtWeightTime.Text , _
ValtxtWeightCost.Text ,
ValtxtWidth.Text , cboCondition.Text , _ ValtxtDensity.Text
, ValtxtFixedCost.Text , ValtxtVariableCost.Text
, _ cboMaxVehicleSize.Text
, ValtxtMaxVehicleSpeed.Text
cn.Execute SQL Exit Sub
ErrHandler: Alert
End Sub Private Sub txtMaxVehicleSpeed_Change
If ValtxtMaxVehicleSpeed.Text 0 Then txtWeightTime.Text
= FormatValtxtWeightDistance.Text
ValtxtMaxVehicleSpeed.Text 1000 60, 0 Else
txtMaxVehicleSpeed.Text = 0 End If
End Sub Procedure Algoritma Djikstra
Option Explicit Private Type LineType
From As Long To As Long
Weight As Single End Type
Private Type PathType Lines As LineType
Count As Long Weight As Single
End Type Private mPaths As PathType
Private mLineIndex As Long Public Sub CalculateByVal PointFrom As Long, ByVal PointTo
As Long, Mattrice As Single, ShortestPath As Collection Dim PathResult As String
Dim Paths As String Dim Lines As String
Dim Points As String Dim i As Long, j As Long
Dim MinWeight As Single Dim ShortestPathIndex As Long
Dim PredLines As String Dim PredPoints As String
Dim CurrPoint As String Dim k As Long, l As Long
Dim Endian As String FindPath
PointFrom, PointFrom,
PointTo, Mattrice,
PathResult Example Path: 2-1,1-4;2-3,3-4;2-5,5-4;2-6,6-1,1-4;6-
3,3-4; Paths = SplitPathResult, ;
Parse path... If UBoundPaths 0 Then
ReDim mPathsUBoundPaths For i = 0 To UBoundPaths
If EndsWithPathsi, CStrPointTo Then mLineIndex = 0
Lines = SplitPathsi, , If UBoundLines 0 Then
For j = 0 To UBoundLines Points = SplitLinesj, -
If UBoundPoints 0 Then If j = 0 And Points0
PointFrom Then get predecessor paths...
CurrPoint = Points0
Do For k = i - 1 To 0 Step
-1 PredLines
= SplitPathsk, ,
If UBoundPredLines 0 Then
For l
= UBoundPredLines To 0 Step -1
PredPoints = SplitPredLinesl, -
If UBoundPredPoints 0 Then
If PredPoints1 = CurrPoint Then
mLineIndex = mLineIndex + 1 ReDim Preserve mPathsi.LinesmLineIndex
mPathsi.LinesmLineIndex.From = PredPoints0 mPathsi.LinesmLineIndex.To = PredPoints1
mPathsi.Count = mLineIndex CurrPoint = PredPoints0
If CurrPoint = PointFrom Then Exit Do
End If End If
Next End If
Next Loop Until PredPoints0 =
PointFrom End If
mLineIndex = mLineIndex + 1 ReDim
Preserve mPathsi.LinesmLineIndex
mPathsi.LinesmLineIndex.From = Points0
mPathsi.LinesmLineIndex.To = Points1
mPathsi.Count = mLineIndex End If
Next ElseIf InStrPathsi, - 0 Then
Points = SplitLines0, - If UBoundPoints 0 Then
If Points0 PointFrom Then
get predecessor paths... CurrPoint = Points0
Do For k = i - 1 To 0 Step -1
PredLines
= SplitPathsk, ,
If UBoundPredLines 0 Then
For l
= UBoundPredLines To 0 Step -1
PredPoints =
SplitPredLinesl, - If
UBoundPredPoints 0 Then If
PredPoints1 = CurrPoint Then mLineIndex = mLineIndex + 1
ReDim Preserve mPathsi.LinesmLineIndex
mPathsi.LinesmLineIndex.From = PredPoints0 mPathsi.LinesmLineIndex.To = PredPoints1
mPathsi.Count = mLineIndex CurrPoint = PredPoints0
If CurrPoint = PointFrom Then Exit Do
End If End If
Next End If
Next Loop
Until PredPoints0
= PointFrom
End If mLineIndex = mLineIndex + 1
ReDim
Preserve mPathsi.LinesmLineIndex
mPathsi.LinesmLineIndex.From =
Points0 mPathsi.LinesmLineIndex.To
= Points1
mPathsi.Count = mLineIndex End If
End If End If
Next End If
If UBoundPaths = 0 Then Exit Sub Calculate weight for every line...
For i = 0 To UBoundmPaths - 1 If mPathsi.Count 0 Then
For j = 1 To UBoundmPathsi.Lines mPathsi.Linesj.Weight
= MattricemPathsi.Linesj.From, mPathsi.Linesj.To
Debug.Print i,
mPathsi.Linesj.From, mPathsi.Linesj.To, mPathsi.Linesj.Weight
Next End If
Next Calculate weight for every path...
For i = 0 To UBoundmPaths - 1 If mPathsi.Count 0 Then
mPathsi.Weight = CalculatePathWeighti Debug.Print mPathsi.Weight
End If Next
Finally, the shortest path is a path with minimum weight among of all...
MinWeight = 999999999 ShortestPathIndex = 0
For i = 0 To UBoundmPaths - 1 If mPathsi.Count 0 Then
If mPathsi.Weight MinWeight Then MinWeight = mPathsi.Weight
ShortestPathIndex = i End If
End If Next
If UBoundmPaths 0 Then For j = 1 To mPathsShortestPathIndex.Count
ShortestPath.Add mPathsShortestPathIndex.Linesj.From
If j = mPathsShortestPathIndex.Count Then ShortestPath.Add
mPathsShortestPathIndex.Linesj.To End If
Next End If
End Sub Private Sub FindPathByVal PointFrom As Long, ByVal
PointThrough As Long, ByVal PointTo As Long, Mattrice As Single, Path As String
Dim Point As Long
For Point = 1 To UBoundMattrice If
Point PointThrough
And IsNeighboursPointThrough, Point, Mattrice Then
Path = Path PointThrough - Point Debug.Print GetPointNamePointThrough -
GetPointNamePoint; If Point PointTo Then
Path = Path , Debug.Print ,;
FindPath
PointFrom, Point,
PointTo, Mattrice, Path
Else Path = Path ;
Debug.Print ;; Exit Sub
End If End If
Next Path = Path ;
Debug.Print ;; End Sub
Private Function IsNeighboursByVal PointFrom As Long, ByVal PointTo As Long, Mattrice As Single As Boolean
If MattricePointFrom, PointTo 0 Then IsNeighbours = True
End If End Function
Private Function CalculatePathWeightByVal PathIndex As Integer As Single
Dim i As Long Dim Weight As Single
For i = 1 To UBoundmPathsPathIndex.Lines Weight = Weight + mPathsPathIndex.Linesi.Weight
Next CalculatePathWeight = Weight
End Function Private Function EndsWithByVal S As String, ByVal Endian As
String As Boolean If RightS, LenEndian = Endian Then
EndsWith = True Else
EndsWith = False End If
End Function Procedure Export ke File Excel
Option Explicit Private ex As Excel.Application
Private wb As Excel.Workbook Private ws As Excel.Worksheet
Public Event ErrorByVal Description As String Private Sub Class_Initialize
Set ex = New Excel.Application ex.DisplayAlerts = False
ex.ScreenUpdating = False ex.Visible = False
End Sub Private Sub Class_Terminate
Set ws = Nothing Set wb = Nothing
Set ex = Nothing End Sub
Public Sub OpenFileByVal FileName As String If DirFileName Then
Set wb = ex.Workbooks.OpenFileName Else
RaiseEvent ErrorFile FileName doesnt exist.
End If End Sub
Public Sub OpenSheetByVal SheetName As String On Error Resume Next
Set ws = wb.WorksheetsSheetName If Err Then
RaiseEvent ErrorErr.Description End If
On Error GoTo 0 End Sub
Public Sub CloseFile wb.Close
End Sub Public Sub SaveFile
wb.Save End Sub
Public Sub WriteDataByVal Row As Integer, ByVal Col As Integer, ByVal Value As String
ws.CellsRow, Col.Value = Value End Sub
Public Sub WriteFormulaByVal Row As Integer, ByVal Col As Integer, ByVal Formula As String
ws.CellsRow, Col.Formula = Formula End Sub
Procedure Alokasi dari Kebun ke Pabrik =========================================
= PROCEDURE: ALOKASI DARI KEBUN KE PABRIK = Developed by: I.K. Gunarta
= Year: 2012 =========================================
Public Terkecil As Long Public NoTerkecil As Integer
Public NoPKS As Integer Public NoKKS As Integer
Public JumlahKKS As Integer Public JumlahPKS As Integer
Public JumlahAlokasi As Integer Public Tahun As Integer
Sub Alokasi JumlahKKS = 160
JumlahPKS = 12 JumlahAlokasi = JumlahKKS JumlahPKS
For Tahun = 0 To 15 SheetsCOST.RangeE5:E1924 = False
For Iterasi = 1 To 1924 Terkecil = 1000000 Bilangan awal yang besar....
NoTerkecil = SheetsCOST.Cells5, 1 For i = 5 To 1924
Biaya = SheetsCOST.Cellsi, 4 Nomor = SheetsCOST.Cellsi, 1
Status = SheetsCOST.Cellsi, 5 If Status = False Then
If Biaya Terkecil Then Terkecil = Biaya
NoTerkecil = Nomor End If
End If Next i
Debug.Print Biaya Terkecil = Terkecil Debug.Print No Terkecil = NoTerkecil
MsgBox Biaya Terkecil = Terkecil MsgBox No Terkecil = NoTerkecil
HitungAlokasi Next Iterasi
Next Tahun End Sub
Public Sub HitungAlokasi NoKKS = Application.RoundUpNoTerkecil 12, 0
BarisPKS = NoTerkecil Mod 12 If BarisPKS = 0 Then
BarisPKS = 12 End If
NoPKS = BarisPKS DemandPKS = SheetsSISA-DEMAND-PKS.CellsNoPKS + 4, 4
+ Tahun SupplyKKS = SheetsSISA-KAPASITAS-KKS.CellsNoKKS +
4, 4 + Tahun Debug.Print Demand PKS = DemandPKS
Debug.Print Supply KKS = SupplyKKS MsgBox SUPPLY KKS = SupplyKKS
MsgBox Demand PKS = DemandPKS If DemandPKS = SupplyKKS Then
AlokasiTBS = DemandPKS SheetsALOKASI.CellsNoTerkecil + 4, 4 + Tahun =
AlokasiTBS DemandTeralokasi
= SheetsPKS-
TERALOKASI.CellsNoPKS + 4, 4 + Tahun SheetsPKS-TERALOKASI.CellsNoPKS + 4, 4 + Tahun
= DemandTeralokasi + AlokasiTBS SupplyTeralokasi
= SheetsKKS-
TERALOKASI.CellsNoKKS + 4, 4 + Tahun SheetsKKS-TERALOKASI.CellsNoKKS + 4, 4 + Tahun
= SupplyTeralokasi + AlokasiTBS SheetsCOST.CellsNoTerkecil + 4, 5 = True
Else AlokasiTBS = SupplyKKS
SheetsALOKASI.CellsNoTerkecil + 4, 4 + Tahun = AlokasiTBS
SheetsCOST.CellsNoTerkecil + 4, 5 = True
DemandTeralokasi =
SheetsPKS- TERALOKASI.CellsNoPKS + 4, 4 + Tahun
SheetsPKS-TERALOKASI.CellsNoPKS + 4, 4 + Tahun = DemandTeralokasi + AlokasiTBS
SupplyTeralokasi
= SheetsKKS-
TERALOKASI.CellsNoKKS + 4, 4 + Tahun SheetsKKS-TERALOKASI.CellsNoKKS + 4, 4 + Tahun
= SupplyTeralokasi + AlokasiTBS End If
End Sub Sub Reset
SheetsALOKASI.RangeD5:AD10000.ClearContents SheetsCOST.RangeE5:E1924 = False
SheetsKKS-TERALOKASI.RangeD5:AD500.ClearContents SheetsPKS-TERALOKASI.RangeD5:AD100.ClearContents
End Sub Procedure Alokasi dari Pabrik CPO ke Industri Hilir
====================================================== = PROCEDURE: ALOKASI DARI PABRIK CPO KE INDUSTRI HILIR
= Developed by: I.K. Gunarta = Year: 2012
====================================================== Public Terkecil As Long
Public NoTerkecil As Integer Public NoPKS As Integer
Public NoHilir As Integer Public JumlahHilir As Integer
Public JumlahPKS As Integer Public JumlahAlokasi As Integer
Public Tahun As Integer Sub Alokasi
JumlahHilir = 3 JumlahPKS = 12
JumlahAlokasi = JumlahHilir JumlahPKS For Tahun = 0 To 15
SheetsCOST.RangeE5:E1924 = False For Iterasi = 1 To JumlahAlokasi
Terkecil = 1000000 Bilangan awal yang besar.... NoTerkecil = SheetsCOST.Cells5, 1
For i = 5 To 1924 Biaya = SheetsCOST.Cellsi, 4
Nomor = SheetsCOST.Cellsi, 1 Status = SheetsCOST.Cellsi, 5
If Status = False Then If Biaya Terkecil Then
Terkecil = Biaya NoTerkecil = Nomor
End If End If
Next i Debug.Print Biaya Terkecil = Terkecil
Debug.Print No Terkecil = NoTerkecil MsgBox Biaya Terkecil = Terkecil
MsgBox No Terkecil = NoTerkecil HitungAlokasi
Next Iterasi Next Tahun
End Sub Public Sub HitungAlokasi
Public Sub HitungAlokasi NoPKS = Application.RoundUpNoTerkecil 3, 0
BarisHilir = NoTerkecil Mod 3 If BarisHilir = 0 Then
BarisHilir = 3 End If
NoHilir = BarisHilir DemandHilir = SheetsSISA-DEMAND-HILIR.CellsNoPKS +
4, 4 + Tahun SupplyKKS = SheetsSISA-KAPASITAS-PKS.CellsNoPKS +
4, 4 + Tahun Debug.Print Demand Hilir = DemandPKS
Debug.Print Supply PKS = SupplyKKS MsgBox SUPPLY PKS = SupplyKKS
MsgBox Demand Hilir = DemandPKS If DemandHilir = SupplyPKS Then
AlokasiCPO = DemandHilir SheetsALOKASI.CellsNoTerkecil + 4, 4 + Tahun =
AlokasiCPO DemandTeralokasi
= SheetsPKS-
TERALOKASI.CellsNoHilir + 4, 4 + Tahun
SheetsHILIR-TERALOKASI.CellsNoPKS + 4, 4 + Tahun = DemandTeralokasi + AlokasiCPO
SupplyTeralokasi =
SheetsPKS- TERALOKASI.CellsNoKPS + 4, 4 + Tahun
SheetsPKS-TERALOKASI.CellsNoKKS + 4, 4 + Tahun = SupplyTeralokasi + AlokasiCPO
SheetsCOST.CellsNoTerkecil + 4, 5 = True Else
AlokasiCPO = SupplyPKS SheetsALOKASI.CellsNoTerkecil + 4, 4 + Tahun =
AlokasiCPO SheetsCOST.CellsNoTerkecil + 4, 5 = True
DemandTeralokasi
= SheetsHILIR-
TERALOKASI.CellsNoPKS + 4, 4 + Tahun SheetsHILIR-TERALOKASI.CellsNoHilir + 4, 4 +
Tahun = DemandTeralokasi + AlokasiCPO SupplyTeralokasi
= SheetsPKS-
TERALOKASI.CellsNoPKS + 4, 4 + Tahun SheetsPKS-TERALOKASI.CellsNoPKS + 4, 4 + Tahun
= SupplyTeralokasi + AlokasiCPO End If
End Sub Sub Reset
SheetsALOKASI.RangeD5:AD10000.ClearContents SheetsCOST.RangeE5:E1924 = False
SheetsPKS-TERALOKASI.RangeD5:AD500.ClearContents SheetsHILIR-
TERALOKASI.RangeD5:AD100.ClearContents End Sub
Script avenue Script Rute
NamaExt=Network Analyst objExt = extension.findNamaExt
if objExt=NIL then msgbox.infoNamaExt++
, belum
diaktifkan..., Perhatian
objExt = Extension.OpenAVEXTnetwork.avx.AsFileName end
dirRsc=D:\DATA GIS\ NamaView= Jaringan Jalan
objView = Av.GetProject.FindDocNamaView ifobjView NIL then
Av.GetProject.RemoveDocobjView end
objView = View.Make Objview.SetNameNamaView
objView.SetUnitsUNITS_LINEAR_METERS objView.GetDisplay.SetDistanceUnitsUNITS_LINEAR_KILOMETERS
objView.GetWin.Open Buka Theme Indonesia CID
objDataCID=SrcName.MakedirRsc+Indonesia.shp objThemeCID = Theme.MakeobjDataCID
objThemeCID.SetNameCID objThemeCID.SetVisibletrue
objThemeCID.SetActivetrue objLeCID = objThemeCID.GetLegend
objSymCID=objLeCID.GetSymbols.get0 objSymCID.SetColorColor.GetWhite
objThemeCID.UpdateLegend objView.AddThemeobjThemeCID
Buka Theme Prov objDataProv=SrcName.MakedirRsc+Propinsi.shp
objThemeProv = Theme.MakeobjDataProv objThemeProv.SetNameProv
objThemeProv.SetVisibletrue objThemeProv.SetActivetrue
objLePro = objThemeProv.GetLegend objSymPro=objLePro.GetSymbols.get0
objSymPro.SetColorColor.GetGray objThemeProv.UpdateLegend
objView.AddThemeobjThemeProv Buka Theme KabKota
objDataKabKota=SrcName.MakedirRsc+Kabupaten.shp objThemeKabKota = Theme.MakeobjDataKabKota
objThemeKabKota.SetNameKabKota objThemeKabKota.SetVisibletrue
objThemeKabKota.SetActivetrue objLeKabKota = objThemeKabKota.GetLegend
objSymKabKota=objLeKabKota.GetSymbols.get0 objSymKabKota.SetColorcolor.GetYellow
objThemeKabKota.UpdateLegend objView.AddThemeobjThemeKabKota
Buka Theme Jalan objDataJalan=SrcName.MakedirRsc+JalanGabung.shp
objThemeJalan = Theme.MakeobjDataJalan objThemeJalan.SetNameJalan
objThemeJalan.SetVisibletrue
objThemeJalan.SetActivetrue objLeJalan = objThemeJalan.GetLegend
objSymJalan=objLeJalan.GetSymbols.get0 objSymJalan.SetColorColor.GetBlack
objSymJalan.SetSize2 objThemeJalan.UpdateLegend
objView.AddThemeobjThemeJalan Buka
Theme Alternative
objDataAlt1=SrcName.MakedirRsc+Theme1.shp objThemeAlt1 = Theme.MakeobjDataAlt1
objThemeAlt1.SetNameAlternativ objThemeAlt1.SetVisibletrue
objThemeAlt1.SetActivetrue objLeAlt1 = objThemeAlt1.GetLegend
objSymAlt1=objLeAlt1.GetSymbols.get0 objSymAlt1.SetColorColor.GetRed
objSymAlt1.SetSize8 objThemeAlt1.UpdateLegend
objView.AddThemeobjThemeAlt1 Buka Theme Dermaga
objDataDermaga=SrcName.MakedirRsc+Dermaga.shp objThemeDermaga = Theme.MakeobjDataDermaga
objThemeDermaga.SetNameDermaga objThemeDermaga.SetVisibletrue
objThemeDermaga.SetActivetrue objLeDermaga = objThemeDermaga.GetLegend
objSymDermaga=objLeDermaga.GetSymbols.get0 objSymDermaga.SetColorColor.GetCyan
objSymDermaga.SetSize8 objThemeDermaga.UpdateLegend
objView.AddThemeobjThemeDermaga Buka Theme Kks Node
Perkebunan objDataKksNode=SrcName.MakedirRsc+Kks_node.shp
objThemeKksNode = Theme.MakeobjDataKksNode objThemeKksNode.SetNamePerkebunan
objThemeKksNode.SetVisibletrue objThemeKksNode.SetActivetrue
objLeKksNode = objThemeKksNode.GetLegend objSymKksNode=objLeKksNode.GetSymbols.get0
objSymKksNode.SetColorColor.GetGreen objSymKksNode.SetSize8
objThemeKksNode.UpdateLegend objView.AddThemeobjThemeKksNode
Buka
Theme PKS
Pabrik objDataPKS=SrcName.MakedirRsc+Pks.shp
objThemePKS = Theme.MakeobjDataPKS
objThemePKS.SetNamePabrik objThemePKS.SetVisibletrue
objThemePKS.SetActivetrue objLePKS = objThemePKS.GetLegend
objSymPKS=objLePKS.GetSymbols.get0 objSymPKS.SetColorColor.GetGray
objSymPKS.SetSize8 objThemePKS.UpdateLegend
objView.AddThemeobjThemePKS objFTabJalan=objThemeJalan.GetFTab
objNetDef=NetDef.MakeobjFTabJalan objNetwork=Network.MakeobjNetDef
av.GetActiveDoc.GetWin.Maximize Script Terdekat
NamaExt=Network Analyst objExt = extension.findNamaExt
if objExt=NIL then msgbox.infoNamaExt++
, belum
diaktifkan..., Perhatian
objExt = Extension.OpenAVEXTnetwork.avx.AsFileName end
dirRsc=D:\DATA GIS\ NamaView= Jaringan Jalan
objView = Av.GetProject.FindDocNamaView ifobjView NIL then
Av.GetProject.RemoveDocobjView end
objView = View.Make Objview.SetNameNamaView
objView.SetUnitsUNITS_LINEAR_METERS objView.GetDisplay.SetDistanceUnitsUNITS_LINEAR_KILOMETERS
objView.GetWin.Open Buka Theme Indonesia CID
objDataCID=SrcName.MakedirRsc+Indonesia.shp objThemeCID = Theme.MakeobjDataCID
objThemeCID.SetNameCID objThemeCID.SetVisibletrue
objThemeCID.SetActivetrue objLeCID = objThemeCID.GetLegend
objSymCID=objLeCID.GetSymbols.get0 objSymCID.SetColorColor.GetWhite
objThemeCID.UpdateLegend objView.AddThemeobjThemeCID
Buka Theme Prov objDataProv=SrcName.MakedirRsc+Propinsi.shp
objThemeProv = Theme.MakeobjDataProv objThemeProv.SetNameProv
objThemeProv.SetVisibletrue objThemeProv.SetActivetrue
objLePro = objThemeProv.GetLegend objSymPro=objLePro.GetSymbols.get0
objSymPro.SetColorColor.GetGray objThemeProv.UpdateLegend
objView.AddThemeobjThemeProv Buka Theme KabKota
objDataKabKota=SrcName.MakedirRsc+Kabupaten.shp objThemeKabKota = Theme.MakeobjDataKabKota
objThemeKabKota.SetNameKabKota objThemeKabKota.SetVisibletrue
objThemeKabKota.SetActivetrue objLeKabKota = objThemeKabKota.GetLegend
objSymKabKota=objLeKabKota.GetSymbols.get0 objSymKabKota.SetColorcolor.GetYellow
objThemeKabKota.UpdateLegend objView.AddThemeobjThemeKabKota
Buka Theme Jalan objDataJalan=SrcName.MakedirRsc+JalanGabung.shp
objThemeJalan = Theme.MakeobjDataJalan objThemeJalan.SetNameJalan
objThemeJalan.SetVisibletrue objThemeJalan.SetActivetrue
objLeJalan = objThemeJalan.GetLegend objSymJalan=objLeJalan.GetSymbols.get0
objSymJalan.SetColorColor.GetBlack objSymJalan.SetSize2
objThemeJalan.UpdateLegend objView.AddThemeobjThemeJalan
Buka
Theme Alternative
objDataAlt1=SrcName.MakedirRsc+Theme1.shp objThemeAlt1 = Theme.MakeobjDataAlt1
objThemeAlt1.SetNameAlternativ objThemeAlt1.SetVisibletrue
objThemeAlt1.SetActivetrue objLeAlt1 = objThemeAlt1.GetLegend
objSymAlt1=objLeAlt1.GetSymbols.get0 objSymAlt1.SetColorColor.GetRed
objSymAlt1.SetSize8 objThemeAlt1.UpdateLegend
objView.AddThemeobjThemeAlt1 Buka Theme Dermaga
objDataDermaga=SrcName.MakedirRsc+Dermaga.shp objThemeDermaga = Theme.MakeobjDataDermaga
objThemeDermaga.SetNameDermaga objThemeDermaga.SetVisibletrue
objThemeDermaga.SetActivetrue objLeDermaga = objThemeDermaga.GetLegend
objSymDermaga=objLeDermaga.GetSymbols.get0 objSymDermaga.SetColorColor.GetBlue
objSymDermaga.SetSize8 objThemeDermaga.UpdateLegend
objView.AddThemeobjThemeDermaga Buka Theme Kks Node
Perkebunan objDataKksNode=SrcName.MakedirRsc+Kks_node.shp
objThemeKksNode = Theme.MakeobjDataKksNode objThemeKksNode.SetNamePerkebunan
objThemeKksNode.SetVisibletrue objThemeKksNode.SetActivetrue
objLeKksNode = objThemeKksNode.GetLegend objSymKksNode=objLeKksNode.GetSymbols.get0
objSymKksNode.SetColorColor.GetGreen objSymKksNode.SetSize8
objThemeKksNode.UpdateLegend objView.AddThemeobjThemeKksNode
Buka
Theme PKS
Pabrik objDataPKS=SrcName.MakedirRsc+Pks.shp
objThemePKS = Theme.MakeobjDataPKS objThemePKS.SetNamePabrik
objThemePKS.SetVisibletrue objThemePKS.SetActivetrue
objLePKS = objThemePKS.GetLegend objSymPKS=objLePKS.GetSymbols.get0
objSymPKS.SetColorColor.GetGray objSymPKS.SetSize8
objThemePKS.UpdateLegend objView.AddThemeobjThemePKS
Tentukan Network objFTabJalan=objThemeJalan.GetFTab
objNetDef=NetDef.MakeobjFTabJalan objNetwork=Network.MakeobjNetDef
Tentukan Field Cost objCostFieldList=objNetDef.GetCostFields
Pertanyaan=Pilih field yang akan dijadikan sebagai COST Judul=Pemilihan Cost
ifobjCostFieldList.Count1 then objCostField=msgbox.ChoiceobjCostFieldList,Pertanyaan,Judul
else
ObjCostField=objCostFieldList.Get0 end
objNetwork.SetCostFieldobjCostField objFTabFasilitas = objThemeDermaga.GetFtab
objFieldLabelFasilitas = ObjThemeDermaga.GetLabelField objFieldShapeFasilitas = objFTabFasilitas.FindFieldShape
objListfasilitas = {} for each idx in objFTabFasilitas
objFasilitas
= objFTabFasilitas.ReturnValueobjFieldShapeFasilitas, idx
ifobjNetwork.isPointOnNetWorkobjFasilitas then objFasilitas.SetNameobjFTabFasilitas.ReturnValueStringobjF
ieldLabelFasilitas,idx objListFasilitas.AddobjFasilitas
end end
objFTabEvent = objThemePKS.GetFTab objFieldLabelEvent = objThemePKS.GetLabelField
objFieldShapeEvent = objFTabEvent.FindFieldShape objListEvent = {}
for each index in objFTabEvent objEvent = objFTabEvent.ReturnValueobjFieldShapeEvent,
index ifobjNetwork.IsPointOnNetWorkobjEvent then
objEvent.SetNameobjFTabEvent.ReturnValueStringobjFieldLabe lEvent, Index
objListEvent.addobjEvent end
end JmlFasilitas = 3
CutOff = 0 EventKeFasilitas = True
objListRute
= ObjNetwork.FindClosestFacobjListEvent,objListFasilitas,jmlF
asilitas,CutOff, EventKeFasilitas ifnotobjNetwork.HasClosestFacResultthen
msgbox.ErrorSolusi rute terdekat tidak tercapai, Kesalahan
exit end
StringListHasil = {} ListIndeksIJ = {}
objNamaFile = dirRsc+ JarakPD.csv objOpenFile=LineFile.MakeobjNamaFile.AsFileName,
FILE_PERM_WRITE objOpenFile.writeEltPabrik, Dermaga, Cost
for each i in 0..objListEvent.Count -1 for each j in 1..objListRute.Geti
NoFasilitas = objNetwork.GetClosestFacIndexi,j str = Dari ++objListEvent.Geti.GetName++ , Ke
++objListFasilitas.GetNoFasilitas.GetName++ Cost
: ++objNetwork.GetClosestFacPathCosti,j.asString
strtls =
objListEvent.Geti.GetName++ ,
++objListFasilitas.GetNoFasilitas.GetName++ ,
++objNetwork.GetClosestFacPathCosti,j.asString stringListHasil.Addstr
objOpenFile.writeEltstrtls ListIndeksIJ.add{i,j}
end end
objRutePilihan = msgBox.ListAsStringStringListHasil, Pilih salah satu rute:,Pilih Rute
IndexTerpilih=StringListHasil.FindByValueobjRutePilihan EventTerpilih = ListIndeksIJ.GetIndexTerpilih.Get0
FasilitasTerpilih = ListIndeksIJ.GetIndexTerpilih.Get1 objRuteTerpilih
= objNetwork.ReturnClosestFacShapeeventTerpilih,
FasilitasTerpilih objGrafikShapeRuteTerpilih
= GraphicShape.MakeobjRuteTerpilih
objSimbolRute = Symbol.MakeSYMBOL_PEN objSimbolRute.SetSize2
objSimbolRute.SetColorColor.GetRed objGrafikShapeRuteTerpilih.SetSymbolobjSimbolRute
objView.GetGraphics.AddobjGrafikShapeRuteTerpilih NamaFileRute = dirRsc+ rute.shp
objNetwork.WriteClosestFacnamaFileRute.AsFileName objView.Invalidate
av.GetActiveDoc.GetWin.Maximize Script TerdekatKP
NamaExt=Network Analyst objExt = extension.findNamaExt
if objExt=NIL then msgbox.infoNamaExt++
, belum
diaktifkan..., Perhatian
objExt = Extension.OpenAVEXTnetwork.avx.AsFileName end
dirRsc=D:\DATA GIS\ NamaView= Jaringan Jalan
objView = Av.GetProject.FindDocNamaView ifobjView NIL then
Av.GetProject.RemoveDocobjView end
objView = View.Make Objview.SetNameNamaView
objView.SetUnitsUNITS_LINEAR_METERS objView.GetDisplay.SetDistanceUnitsUNITS_LINEAR_KILOMETERS
objView.GetWin.Open Buka Theme Indonesia CID
objDataCID=SrcName.MakedirRsc+Indonesia.shp objThemeCID = Theme.MakeobjDataCID
objThemeCID.SetNameCID objThemeCID.SetVisibletrue
objThemeCID.SetActivetrue objLeCID = objThemeCID.GetLegend
objSymCID=objLeCID.GetSymbols.get0 objSymCID.SetColorColor.GetWhite
objThemeCID.UpdateLegend objView.AddThemeobjThemeCID
Buka Theme Prov objDataProv=SrcName.MakedirRsc+Propinsi.shp
objThemeProv = Theme.MakeobjDataProv objThemeProv.SetNameProv
objThemeProv.SetVisibletrue objThemeProv.SetActivetrue
objLePro = objThemeProv.GetLegend objSymPro=objLePro.GetSymbols.get0
objSymPro.SetColorColor.GetGray objThemeProv.UpdateLegend
objView.AddThemeobjThemeProv Buka Theme KabKota
objDataKabKota=SrcName.MakedirRsc+Kabupaten.shp objThemeKabKota = Theme.MakeobjDataKabKota
objThemeKabKota.SetNameKabKota objThemeKabKota.SetVisibletrue
objThemeKabKota.SetActivetrue objLeKabKota = objThemeKabKota.GetLegend
objSymKabKota=objLeKabKota.GetSymbols.get0 objSymKabKota.SetColorcolor.GetYellow
objThemeKabKota.UpdateLegend objView.AddThemeobjThemeKabKota
Buka Theme Jalan objDataJalan=SrcName.MakedirRsc+JalanGabung.shp
objThemeJalan = Theme.MakeobjDataJalan objThemeJalan.SetNameJalan
objThemeJalan.SetVisibletrue objThemeJalan.SetActivetrue
objLeJalan = objThemeJalan.GetLegend objSymJalan=objLeJalan.GetSymbols.get0
objSymJalan.SetColorColor.GetBlack objSymJalan.SetSize2
objThemeJalan.UpdateLegend
objView.AddThemeobjThemeJalan Buka
Theme Alternative
objDataAlt1=SrcName.MakedirRsc+Theme1.shp objThemeAlt1 = Theme.MakeobjDataAlt1
objThemeAlt1.SetNameAlternativ objThemeAlt1.SetVisibletrue
objThemeAlt1.SetActivetrue objLeAlt1 = objThemeAlt1.GetLegend
objSymAlt1=objLeAlt1.GetSymbols.get0 objSymAlt1.SetColorColor.GetRed
objSymAlt1.SetSize8 objThemeAlt1.UpdateLegend
objView.AddThemeobjThemeAlt1 Buka Theme Dermaga
objDataDermaga=SrcName.MakedirRsc+Dermaga.shp objThemeDermaga = Theme.MakeobjDataDermaga
objThemeDermaga.SetNameDermaga objThemeDermaga.SetVisibletrue
objThemeDermaga.SetActivetrue objLeDermaga = objThemeDermaga.GetLegend
objSymDermaga=objLeDermaga.GetSymbols.get0 objSymDermaga.SetColorColor.GetBlue
objSymDermaga.SetSize8 objThemeDermaga.UpdateLegend
objView.AddThemeobjThemeDermaga Buka Theme Kks Node
Perkebunan objDataKksNode=SrcName.MakedirRsc+Kks_node.shp
objThemeKksNode = Theme.MakeobjDataKksNode objThemeKksNode.SetNamePerkebunan
objThemeKksNode.SetVisibletrue objThemeKksNode.SetActivetrue
objLeKksNode = objThemeKksNode.GetLegend objSymKksNode=objLeKksNode.GetSymbols.get0
objSymKksNode.SetColorColor.GetGreen objSymKksNode.SetSize8
objThemeKksNode.UpdateLegend objView.AddThemeobjThemeKksNode
Buka
Theme PKS
Pabrik objDataPKS=SrcName.MakedirRsc+Pks.shp
objThemePKS = Theme.MakeobjDataPKS objThemePKS.SetNamePabrik
objThemePKS.SetVisibletrue objThemePKS.SetActivetrue
objLePKS = objThemePKS.GetLegend objSymPKS=objLePKS.GetSymbols.get0
objSymPKS.SetColorColor.GetGray
objSymPKS.SetSize8 objThemePKS.UpdateLegend
objView.AddThemeobjThemePKS Tentukan Network
objFTabJalan=objThemeJalan.GetFTab objNetDef=NetDef.MakeobjFTabJalan
objNetwork=Network.MakeobjNetDef Tentukan Field Cost
objCostFieldList=objNetDef.GetCostFields Pertanyaan=Pilih field yang akan dijadikan sebagai COST
Judul=Pemilihan Cost ifobjCostFieldList.Count1 then
objCostField=msgbox.ChoiceobjCostFieldList,Pertanyaan,Judul else
ObjCostField=objCostFieldList.Get0 end
objNetwork.SetCostFieldobjCostField objFTabFasilitas = objThemePKS.GetFtab
objFieldLabelFasilitas = ObjThemePKS.GetLabelField objFieldShapeFasilitas = objFTabFasilitas.FindFieldShape
objListfasilitas = {} for each idx in objFTabFasilitas
objFasilitas
= objFTabFasilitas.ReturnValueobjFieldShapeFasilitas, idx
ifobjNetwork.isPointOnNetWorkobjFasilitas then objFasilitas.SetNameobjFTabFasilitas.ReturnValueStringobjF
ieldLabelFasilitas,idx objListFasilitas.AddobjFasilitas
end end
objFTabEvent = objThemeKKSNode.GetFTab objFieldLabelEvent = objThemeKKSNode.GetLabelField
objFieldShapeEvent = objFTabEvent.FindFieldShape objListEvent = {}
for each index in objFTabEvent objEvent = objFTabEvent.ReturnValueobjFieldShapeEvent,
index ifobjNetwork.IsPointOnNetWorkobjEvent then
objEvent.SetNameobjFTabEvent.ReturnValueStringobjFieldLabe lEvent, Index
objListEvent.addobjEvent end
end
JmlFasilitas = 13 CutOff = 0
EventKeFasilitas = True objListRute
= ObjNetwork.FindClosestFacobjListEvent,objListFasilitas,jmlF
asilitas,CutOff, EventKeFasilitas ifnotobjNetwork.HasClosestFacResultthen
msgbox.ErrorSolusi rute terdekat tidak tercapai, Kesalahan
exit end
StringListHasil = {} ListIndeksIJ = {}
ListStrTulist={} objNamaFile = dirRsc+ JarakKP.csv
objOpenFile=LineFile.MakeobjNamaFile.AsFileName, FILE_PERM_WRITE
objOpenFile.writeEltKebun, Pabrik, Cost for each i in 0..objListEvent.Count -1
for each j in 1..objListRute.Geti NoFasilitas = objNetwork.GetClosestFacIndexi,j
str = Dari ++objListEvent.Geti.GetName++ , Ke ++objListFasilitas.GetNoFasilitas.GetName++
Cost :
++objNetwork.GetClosestFacPathCosti,j.asString strtls
= objListEvent.Geti.GetName++
, ++objListFasilitas.GetNoFasilitas.GetName++
, ++objNetwork.GetClosestFacPathCosti,j.asString
stringListHasil.Addstr objOpenFile.writeEltstrtls
ListIndeksIJ.add{i,j} end
end objRutePilihan = msgBox.ListAsStringStringListHasil, Pilih
salah satu rute:,Pilih Rute IndexTerpilih=StringListHasil.FindByValueobjRutePilihan
EventTerpilih = ListIndeksIJ.GetIndexTerpilih.Get0 FasilitasTerpilih = ListIndeksIJ.GetIndexTerpilih.Get1
objRuteTerpilih
= objNetwork.ReturnClosestFacShapeeventTerpilih,
FasilitasTerpilih objGrafikShapeRuteTerpilih
= GraphicShape.MakeobjRuteTerpilih
objSimbolRute = Symbol.MakeSYMBOL_PEN objSimbolRute.SetSize2
objSimbolRute.SetColorColor.GetRed objGrafikShapeRuteTerpilih.SetSymbolobjSimbolRute
objView.GetGraphics.AddobjGrafikShapeRuteTerpilih NamaFileRute = dirRsc+ rute.shp
objNetwork.WriteClosestFacnamaFileRute.AsFileName objView.Invalidate
av.GetActiveDoc.GetWin.Maximize Script PabrikAlternativ
NamaExt=Network Analyst objExt = extension.findNamaExt
if objExt=NIL then msgbox.infoNamaExt++
, belum
diaktifkan..., Perhatian
objExt = Extension.OpenAVEXTnetwork.avx.AsFileName end
dirRsc=D:\DATA GIS\ NamaView= Jaringan Jalan
objView = Av.GetProject.FindDocNamaView ifobjView NIL then
Av.GetProject.RemoveDocobjView end
objView = View.Make Objview.SetNameNamaView
objView.SetUnitsUNITS_LINEAR_METERS objView.GetDisplay.SetDistanceUnitsUNITS_LINEAR_KILOMETERS
objView.GetWin.Open Buka Theme Indonesia CID
objDataCID=SrcName.MakedirRsc+Indonesia.shp objThemeCID = Theme.MakeobjDataCID
objThemeCID.SetNameCID objThemeCID.SetVisibletrue
objThemeCID.SetActivefalse objLeCID = objThemeCID.GetLegend
objSymCID=objLeCID.GetSymbols.get0 objSymCID.SetColorColor.GetWhite
objThemeCID.UpdateLegend objView.AddThemeobjThemeCID
Buka Theme Prov objDataProv=SrcName.MakedirRsc+Propinsi.shp
objThemeProv = Theme.MakeobjDataProv objThemeProv.SetNameProv
objThemeProv.SetVisibletrue objThemeProv.SetActivefalse
objLePro = objThemeProv.GetLegend objSymPro=objLePro.GetSymbols.get0
objSymPro.SetColorColor.GetGray objThemeProv.UpdateLegend
objView.AddThemeobjThemeProv Buka Theme KabKota
objDataKabKota=SrcName.MakedirRsc+Kabupaten.shp objThemeKabKota = Theme.MakeobjDataKabKota
objThemeKabKota.SetNameKabKota
objThemeKabKota.SetVisibletrue objThemeKabKota.SetActivefalse
objLeKabKota = objThemeKabKota.GetLegend objSymKabKota=objLeKabKota.GetSymbols.get0
objSymKabKota.SetColorcolor.GetYellow objThemeKabKota.UpdateLegend
objView.AddThemeobjThemeKabKota Buka Theme Zoning
objDataZoning=SrcName.MakedirRsc+Zonasi.shp objThemeZoning = Theme.MakeobjDataZoning
objThemeZoning.SetNameZoning objThemeZoning.SetVisibletrue
objThemeZoning.SetActivetrue objLeZoning = objThemeZoning.GetLegend
objSymZoning=objLeZoning.GetSymbols.get0 objSymZoning.SetColorcolor.GetCyan
objThemeZoning.UpdateLegend objView.AddThemeobjThemeZoning
Buka Theme Jalan objDataJalan=SrcName.MakedirRsc+JalanGabung.shp
objThemeJalan = Theme.MakeobjDataJalan objThemeJalan.SetNameJalan
objThemeJalan.SetVisibletrue objThemeJalan.SetActiveFalse
objLeJalan = objThemeJalan.GetLegend objSymJalan=objLeJalan.GetSymbols.get0
objSymJalan.SetColorColor.GetBlack objSymJalan.SetSize2
objThemeJalan.UpdateLegend objView.AddThemeobjThemeJalan
Buka
Theme Alternative
objDataAlt1=SrcName.MakedirRsc+Theme1.shp objThemeAlt1 = Theme.MakeobjDataAlt1
objThemeAlt1.SetNameAlternativ objThemeAlt1.SetVisibletrue
objThemeAlt1.SetActivefalse objLeAlt1 = objThemeAlt1.GetLegend
objSymAlt1=objLeAlt1.GetSymbols.get0 objSymAlt1.SetColorColor.GetRed
objSymAlt1.SetSize8 objThemeAlt1.UpdateLegend
objView.AddThemeobjThemeAlt1 Buka Theme Dermaga
objDataDermaga=SrcName.MakedirRsc+Dermaga.shp objThemeDermaga = Theme.MakeobjDataDermaga
objThemeDermaga.SetNameDermaga objThemeDermaga.SetVisibletrue
objThemeDermaga.SetActivefalse objLeDermaga = objThemeDermaga.GetLegend
objSymDermaga=objLeDermaga.GetSymbols.get0 objSymDermaga.SetColorColor.GetBlue
objSymDermaga.SetSize8 objThemeDermaga.UpdateLegend
objView.AddThemeobjThemeDermaga Buka Theme Kks Node
Perkebunan objDataKksNode=SrcName.MakedirRsc+Kks_node.shp
objThemeKksNode = Theme.MakeobjDataKksNode objThemeKksNode.SetNamePerkebunan
objThemeKksNode.SetVisibletrue objThemeKksNode.SetActivetrue
objLeKksNode = objThemeKksNode.GetLegend objSymKksNode=objLeKksNode.GetSymbols.get0
objSymKksNode.SetColorColor.GetGreen objSymKksNode.SetSize8
objThemeKksNode.UpdateLegend objView.AddThemeobjThemeKksNode
Buka
Theme PKS
Pabrik objDataPKS=SrcName.MakedirRsc+Pks.shp
objThemePKS = Theme.MakeobjDataPKS objThemePKS.SetNamePabrik
objThemePKS.SetVisibletrue objThemePKS.SetActivefalse
objLePKS = objThemePKS.GetLegend objSymPKS=objLePKS.GetSymbols.get0
objSymPKS.SetColorColor.GetGray objSymPKS.SetSize8
objThemePKS.UpdateLegend objView.AddThemeobjThemePKS
objSimbol = Symbol.MakeSYMBOL_MARKER objSimbol.SetStyleBASICMARKER_STYLE_PATTERN
objSimbol.SetColorColor.GetRed objSimbol.SetSize40
objGrafik = objView.GetGraphics objTabelTemp = av.GetProject.FindDocTabel Kebun
ifobjTabelTemp nil then av.GetProject.RemoveDocobjTabelTemp
end objTabelTemp = av.GetProject.FindDocTabel Gabungan
ifobjTabelTemp nil then av.GetProject.RemoveDocobjTabelTemp
end objFTabZona= objThemeZoning.GetFTab
objFTabKebun = objThemeKksNode.GetFtab
objBitmap = objFTabKebun.GetSelection objTabel = Table.MakeobjFTabKebun
objFieldShapeKebun = objFTabKebun.FindFieldShape objTabel.setNameTabel Kebun
objTabel.GetWin.Open objZonaUt = objFTabZona.FindFieldZonaID
if objFTabZona.StartEditingWithRecovery then nZona = 0
saveEdits = False for each index in objFTabZona
nZona = nZona + 1 if
objFTabZona.returnvalueobjZonaUt,indexnZona then
objFTabZona.BeginTransaction objFTabZona.SetValueobjZonaUt,index,nZona
objFTabZona.EndTransaction saveEdits = TRUE
end end
end objFTabZona.StopEditingWithRecoverysaveEdits
objTabelTempz = av.GetProject.FindDocTabel Zona ifobjTabelTempz nil then
av.GetProject.RemoveDocobjTabelTempz end
objTabelZona=Table.MakeobjFTabZona objTabelZona.SetNameTabel Zona
objFieldShapeZona = objFTabZona.FindFieldShape fieldKX = objFTabKebun.findfieldPEMBILX
fieldKY = objFTabKebun.findfieldPEMBILY fieldKap = objFTabKebun.findfieldKAPASITAS
objFTabKebun.JoinobjFieldShapeKebun,objFTabZona,objFieldSha peZona
objfieldZona = objFTabKebun.FindFieldZonaID objTabGab = Table.MakeobjFTabKebun
OBJTabGab.SetNameTabel Gabungan objTabGab.GetWin.Open
objGrafik.empty for each idz in objFTabZona
Zona = objFTabZona.ReturnValueobjZonaUt,idz sumKX = 0
sumKY = 0 SumKapa = 0
for each idx in objFTabKebun if
objFTabKebun.returnvalueobjfieldZona,idx=Zona then
NKX = objFTabKebun.returnvaluefieldKX,idx NKY = objFTabKebun.returnvaluefieldKY,idx
NKapa = objFTabKebun.returnvaluefieldKap,idx else
NKX =0 NKY = 0
NKapa = 0 end
sumKX = SumKX + NKX sumKY = sumKY + NKY
SumKapa = SumKapa + NKapa end
NeoX = sumKXsumKapa NeoY = sumKYsumKapa
objThemeAlt1.SetActiveTrue objTitik=Point.MakeneoX,NeoY
objGrafik = objView.GetGraphics objAlter = GraphicShape.MakeobjTitik
objAlter.setSymbolobjSimbol objGrafik.AddobjAlter
end av.GetActiveDoc.GetWin.Maximize
Script Editdb objNamaAplikasi =ArcView-Client, Ms.Access-Server
Av.SetNameobjNamaAplikasi objDir1 = E:\Program Files\Microsoft Office\Office11\
objDir2 = D:\ProGISGun\ objNamaFileAplikasiMsAccess = objDir1 + MsAccess.exe
objNamaDataMsAccess = objDir2 + dbedit.mde objParameter=objNamaFileAplikasiMsAccess
++ objNamaDataMsAccess
objNamaServer =MsAccess objNamaTopik = System
objClient = DDEClient.MakeobjNamaServer, objNamaTopik ifobjClient.HasErrorthen
System.ExecuteobjParameter objClient=DDeClient.MakeobjNamaServer,objNamaTopik
end Script Kalkulasi.Alokasi
NamaExt=Network Analyst objExt = extension.findNamaExt
if objExt=NIL then msgbox.infoNamaExt++
, belum
diaktifkan..., Perhatian
objExt = Extension.OpenAVEXTnetwork.avx.AsFileName end
dirRsc=D:\DATA GIS\ NamaView= Jaringan Jalan
objView = Av.GetProject.FindDocNamaView ifobjView NIL then
vNamadbf = dirRsc + PENAMPUN.dbf vTabPenampung
= VTab.MakevNamadbf.AsFileName,
True, False
if vTabPenampung.StartEditingWithRecovery then vTabPenampung.BeginTransaction
for each idxPng in vTabPenampung vTabPenampung.removeRecordidxPng
end vTabPenampung.EndTransaction
vTabPenampung.StopEditingWithRecoveryTrue end
objThemeJalan= objView.FindThemeJalan objThemeKksNode= objView.FindThemePerkebunan
objThemePKS= objView.FindThemePabrik objFTabJalan=objThemeJalan.GetFTab
objNetDef=NetDef.MakeobjFTabJalan objNetwork=Network.MakeobjNetDef
Konversi Jarak Biaya jadi cost
objFieldCoast = objFTabJalan.FindFieldCost objFieldJarak = objFTabJalan.FindFieldJarak
objFieldKecepatan = objFTabJalan.FindFieldKecepatan objFieldWaktu = objFTabJalan.FindFieldWaktu
objListPilih = {Biaya, Waktu} vPilihan
= msgbox.ChoiceasstringobjListPilih,Pilih
Komponen Cost,Perhatian ifvPilihan = Nil then
exit elseifvPilihan = Biaya then
if objFTabJalan.StartEditingWithRecovery then for each idxx in objFTabJalan
vKec
= objFTabJalan.ReturnValueobjFieldKecepatan,idxx
ifvKec = 80 then vBiaya = 500
elseifvKec = 70 then vBiaya = 600
elseifvKec = 50 then vBiaya = 750
elseifvKec = 40 then vBiaya = 900
else vBiaya = 1000
end vBiaya
= vBiaya
objFTabJalan.ReturnValueobjFieldJarak,idxx 1000 objFTabJalan.BeginTransaction
objFTabJalan.SetValueobjFieldCoast,idxx,vbiaya objFTabJalan.EndTransaction
end end
objFTabJalan.StopEditingWithRecoveryTrue else
if objFTabJalan.StartEditingWithRecovery then for each idxx in objFTabJalan
vKec
= objFTabJalan.ReturnValueobjFieldKecepatan,idxx
vWaktu =
objFTabJalan.ReturnValueobjFieldJarak,idxx 1000 vKec objFTabJalan.BeginTransaction
objFTabJalan.SetValueobjFieldCoast,idxx,vWaktu objFTabJalan.EndTransaction
end end
objFTabJalan.StopEditingWithRecoveryTrue end
Tentukan Field Cost objCostFieldList=objNetDef.GetCostFields
Pertanyaan=Pilih field yang akan dijadikan sebagai COST Judul=Pemilihan Cost
ifobjCostFieldList.Count1 then objCostField=msgbox.ChoiceobjCostFieldList,Pertanyaan,Judul
else ObjCostField=objCostFieldList.Get0
end objNetwork.SetCostFieldobjCostField
objFTabFasilitas = objThemePKS.GetFtab objFieldLabelFasilitas = ObjThemePKS.GetLabelField
objFieldShapeFasilitas
= objFTabFasilitas.FindFieldShape
objListfasilitas = {} for each idx in objFTabFasilitas
objFasilitas =
objFTabFasilitas.ReturnValueobjFieldShapeFasilitas, idx ifobjNetwork.isPointOnNetWorkobjFasilitas then
objFasilitas.SetNameobjFTabFasilitas.ReturnValueStringobjF ieldLabelFasilitas,idx
objListFasilitas.AddobjFasilitas end
end objFTabEvent = objThemeKKSNode.GetFTab
objFieldLabelEvent = objThemeKKSNode.GetLabelField objFieldShapeEvent = objFTabEvent.FindFieldShape
objListEvent = {} for each index in objFTabEvent
objEvent = objFTabEvent.ReturnValueobjFieldShapeEvent, index
ifobjNetwork.IsPointOnNetWorkobjEvent then
objEvent.SetNameobjFTabEvent.ReturnValueStringobjFieldLabe lEvent, Index
objListEvent.addobjEvent end
end JmlFasilitas = 13
CutOff = 0 EventKeFasilitas = True
objListRute
= ObjNetwork.FindClosestFacobjListEvent,objListFasilitas,jmlF
asilitas,CutOff, EventKeFasilitas ifnotobjNetwork.HasClosestFacResultthen
msgbox.ErrorSolusi rute terdekat tidak tercapai, Kesalahan
exit end
StringListHasil = {} ListIndeksIJ = {}
ListStrTulist={} for each i in 0..objListEvent.Count -1
for each j in 1..objListRute.Geti NoFasilitas = objNetwork.GetClosestFacIndexi,j
str = Dari ++objListEvent.Geti.GetName++ , Ke ++objListFasilitas.GetNoFasilitas.GetName++
Cost :
++objNetwork.GetClosestFacPathCosti,j.asString strtls
= objListEvent.Geti.GetName++
, ++objListFasilitas.GetNoFasilitas.GetName++
, ++objNetwork.GetClosestFacPathCosti,j.asString
stringListHasil.Addstr ListIndeksIJ.add{i,j}
end end
objRuteTerpilih = objNetwork.ReturnClosestFacShape2, 1 NamaFileRute = dirRsc+ rute.shp
objNetwork.WriteClosestFacnamaFileRute.AsFileName objNamaAplikasi =ArcView-Client, Ms.Access-Server
Av.SetNameobjNamaAplikasi objDir1 = E:\Program Files\Microsoft Office\Office11\
objDir2 = D:\ProGISGun\ objNamaFileAplikasiMsAccess = objDir1 + MsAccess.exe
objNamaDataMsAccess = objDir2 + kalkulasi.mde objParameter=objNamaFileAplikasiMsAccess
++ objNamaDataMsAccess
objNamaServer =MsAccess objNamaTopik = System
objClient = DDEClient.MakeobjNamaServer, objNamaTopik ifobjClient.HasErrorthen
System.ExecuteobjParameter objClient=DDeClient.MakeobjNamaServer,objNamaTopik
end end
Script Kalkulasi.alokasi.dermaga NamaExt=Network Analyst
objExt = extension.findNamaExt if objExt=NIL then
msgbox.infoNamaExt++
, belum
diaktifkan..., Perhatian
objExt = Extension.OpenAVEXTnetwork.avx.AsFileName end
dirRsc=D:\DATA GIS\ NamaView= Jaringan Jalan
objView = Av.GetProject.FindDocNamaView ifobjView NIL then
vNamadbf = dirRsc + PENAMPUN.dbf vTabPenampung
= VTab.MakevNamadbf.AsFileName,
True, False
if vTabPenampung.StartEditingWithRecovery then vTabPenampung.BeginTransaction
for each idxPng in vTabPenampung vTabPenampung.removeRecordidxPng
end vTabPenampung.EndTransaction
vTabPenampung.StopEditingWithRecoveryTrue end
objThemeJalan= objView.FindThemeJalan objThemeDermaga= objView.FindThemeDermaga
objThemePKS= objView.FindThemePabrik objFTabJalan=objThemeJalan.GetFTab
objNetDef=NetDef.MakeobjFTabJalan objNetwork=Network.MakeobjNetDef
Konversi Jarak Biaya jadi cost
objFieldCoast = objFTabJalan.FindFieldCost objFieldJarak = objFTabJalan.FindFieldJarak
objFieldKecepatan = objFTabJalan.FindFieldKecepatan objFieldWaktu = objFTabJalan.FindFieldWaktu
objListPilih = {Biaya, Waktu} vPilihan
= msgbox.ChoiceasstringobjListPilih,Pilih
komponen Cost,Perhatian ifvPilihan = NIL then
exit elseifvPilihan = Biaya then
if objFTabJalan.StartEditingWithRecovery then for each idxx in objFTabJalan
vKec
= objFTabJalan.ReturnValueobjFieldKecepatan,idxx
ifvKec = 80 then vBiaya = 500
elseifvKec = 70 then vBiaya = 600
elseifvKec = 50 then vBiaya = 750
elseifvKec = 40 then vBiaya = 900
else vBiaya = 1000
end vBiaya
= vBiaya
objFTabJalan.ReturnValueobjFieldJarak,idxx 1000 objFTabJalan.BeginTransaction
objFTabJalan.SetValueobjFieldCoast,idxx,vbiaya objFTabJalan.EndTransaction
end end
objFTabJalan.StopEditingWithRecoveryTrue else
if objFTabJalan.StartEditingWithRecovery then for each idxx in objFTabJalan
vKec
= objFTabJalan.ReturnValueobjFieldKecepatan,idxx
vWaktu =
objFTabJalan.ReturnValueobjFieldJarak,idxx 1000 vKec objFTabJalan.BeginTransaction
objFTabJalan.SetValueobjFieldCoast,idxx,vWaktu objFTabJalan.EndTransaction
end end
objFTabJalan.StopEditingWithRecoveryTrue end
Tentukan Field Cost objCostFieldList=objNetDef.GetCostFields
Pertanyaan=Pilih field yang akan dijadikan sebagai COST Judul=Pemilihan Cost
ifobjCostFieldList.Count1 then objCostField=msgbox.ChoiceobjCostFieldList,Pertanyaan,Judul
else ObjCostField=objCostFieldList.Get0
end objFTabFasilitas = objThemeDermaga.GetFtab
objFieldLabelFasilitas = ObjThemeDermaga.GetLabelField objFieldShapeFasilitas = objFTabFasilitas.FindFieldShape
objListfasilitas = {} for each idx in objFTabFasilitas
objFasilitas
= objFTabFasilitas.ReturnValueobjFieldShapeFasilitas, idx
ifobjNetwork.isPointOnNetWorkobjFasilitas then
objFasilitas.SetNameobjFTabFasilitas.ReturnValueStringobjF ieldLabelFasilitas,idx
objListFasilitas.AddobjFasilitas end
end objFTabEvent = objThemePKS.GetFTab
objFieldLabelEvent = objThemePKS.GetLabelField objFieldShapeEvent = objFTabEvent.FindFieldShape
objListEvent = {} for each index in objFTabEvent
objEvent = objFTabEvent.ReturnValueobjFieldShapeEvent, index
ifobjNetwork.IsPointOnNetWorkobjEvent then objEvent.SetNameobjFTabEvent.ReturnValueStringobjFieldLabe
lEvent, Index objListEvent.addobjEvent
end end
JmlFasilitas = 3 CutOff = 0
EventKeFasilitas = True objListRute
= ObjNetwork.FindClosestFacobjListEvent,objListFasilitas,jmlF
asilitas,CutOff, EventKeFasilitas ifnotobjNetwork.HasClosestFacResultthen
msgbox.ErrorSolusi rute terdekat tidak tercapai, Kesalahan
exit end
StringListHasil = {} ListIndeksIJ = {}
objNamaFile = dirRsc+ JarakPD.csv objOpenFile=LineFile.MakeobjNamaFile.AsFileName,
FILE_PERM_WRITE objOpenFile.writeEltPabrik, Dermaga, Cost
for each i in 0..objListEvent.Count -1 for each j in 1..objListRute.Geti
NoFasilitas = objNetwork.GetClosestFacIndexi,j str = Dari ++objListEvent.Geti.GetName++ , Ke
++objListFasilitas.GetNoFasilitas.GetName++
Cost :
++objNetwork.GetClosestFacPathCosti,j.asString strtls
= objListEvent.Geti.GetName++
, ++objListFasilitas.GetNoFasilitas.GetName++
, ++objNetwork.GetClosestFacPathCosti,j.asString
stringListHasil.Addstr objOpenFile.writeEltstrtls
ListIndeksIJ.add{i,j} end
end
objRuteTerpilih = objNetwork.ReturnClosestFacShape2, 1 NamaFileRute = dirRsc+ rute.shp
objNetwork.WriteClosestFacnamaFileRute.AsFileName objNamaAplikasi =ArcView-Client, Ms.Access-Server
Av.SetNameobjNamaAplikasi objDir1 = E:\Program Files\Microsoft Office\Office11\
objDir2 = D:\ProGISGun\ objNamaFileAplikasiMsAccess = objDir1 + MsAccess.exe
objNamaDataMsAccess = objDir2 + kalkulasiPD.mde objParameter=objNamaFileAplikasiMsAccess
++ objNamaDataMsAccess
objNamaServer =MsAccess objNamaTopik = System
objClient = DDEClient.MakeobjNamaServer, objNamaTopik ifobjClient.HasErrorthen
System.ExecuteobjParameter objClient=DDeClient.MakeobjNamaServer,objNamaTopik
end end
Script Visualisasi.Alokasi membuat tampilan garis alokasi
av.Runscrview, dirRsc=D:\DATA GIS\
NamaView= Jaringan Jalan objView = Av.GetProject.FindDocNamaView
ifobjView NIL then objThemeJalan= objView.FindThemeJalan
objThemeKksNode= objView.FindThemePerkebunan objThemePKS= objView.FindThemePabrik
objThemeDermaga= objView.FindThemeDermaga vNamadbf = dirRsc + PENAMPUN.dbf
vTabPenampung
= VTab.MakevNamadbf.AsFileName,
True, False
objFldDariPnpg = vTabPenampung.FindFielddari objFldTjPnpg = vTabPenampung.FindFieldTujuan
strKode = vTabPenampung.ReturnValueobjFldDariPnpg,1 ifstrKode.Left3=PKS then
objFTabDari = objThemePKS.GetFTab objFTabTujuan = objThemeDermaga.GetFtab
else objFTabDari = objThemeKksNode.GetFTab
objFTabTujuan = objThemePKS.GetFtab end
objTabPenampung = Table.MakevTabPenampung objFldShapeDari = objFTabDari.findFieldShape
objFldKodeDari = objFTabDari.findFieldKode objFldShapeTjn = objFTabTujuan.FindFieldShape
objFldKodeTjn = objFTabTujuan.FindFieldKode objFldDariPnpg = vTabPenampung.FindFielddari
objFldTjPnpg = vTabPenampung.FindFieldTujuan objGrafik = objView.GetGraphics
for each idxpng in vTabPenampung vDari = vTabPenampung.ReturnValueobjFldDariPnpg,idxpng
for each idxdr in objFTabDari if
objFTabDari.ReturnValueobjFldKodeDari,idxdr=vDari then objTitikDari
= objFTabDari.ReturnValueobjFldShapeDari, idxdr
DariX = objTitikDari.GetX DariY = objTitikDari.GetY
objAsal=Point.makeDariX,DariY end
end vTujuan = vTabPenampung.ReturnValueobjFldTjPnpg,idxpng
for each idxtj in objFTabTujuan if
objFTabTujuan.ReturnValueobjFldKodeTjn, idxtj=vTujuan then
objTitikTujuan=objFTabTujuan.ReturnValueobjFldShapeTjn, idxtj
TujuanX = objTitikTujuan.GetX TujuanY = objTitikTujuan.GetY
objTujuan = Point.MakeTujuanX, TujuanY end
end objGeoGaris = Line.MakeobjTitikDari, objTitikTujuan
objGaris = GraphicShape.MakeobjGeoGaris objgaris.getSymbol.setcolorcolor.getred
objgaris.getsymbol.setsize2 objGrafik.AddobjGaris
objview.invalidate end
end MSAccess
Form Edit Dermaga
VBA Script Option Compare Database
Private Sub btSebelum_Click On Error GoTo Err_btSebelum_Click
Me.btBerikut.Enabled = True DoCmd.GoToRecord , , acPrevious
Exit_btSebelum_Click: Exit Sub
Err_btSebelum_Click: MsgBox First Record, , Me.Caption
Resume Exit_btSebelum_Click End Sub
Private Sub btBerikut_Click On Error GoTo Err_btBerikut_Click
Me.btSebelum.Enabled = True DoCmd.GoToRecord , , acNext
Exit_btBerikut_Click: Exit Sub
Err_btBerikut_Click: MsgBox Last Record, , Me.Caption
Resume Exit_btBerikut_Click End Sub
Private Sub btKeluar_Click On Error GoTo Err_btKeluar_Click
Tutup DoCmd.Close acForm, Me.Name
Exit_btKeluar_Click: Exit Sub
Err_btKeluar_Click: MsgBox Err.Description, , Me.Caption
Resume Exit_btKeluar_Click End Sub
Private Sub Combo21_AfterUpdate Find the record that matches the control.
Dim rs As Object Set rs = Me.Recordset.Clone
rs.FindFirst [ID] = StrNzMe[Combo21], 0 If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub Private Sub Form_Current
On Error GoTo SalahBookmark Dim rs As DAO.Recordset
Dim Sebelum As Boolean Dim Berikut As Boolean
Set rs = Me.RecordsetClone If rs.RecordCount 0 Then
rs.Bookmark = Me.Bookmark TombolNav rs, Sebelum, Berikut
Me.btSebelum.Enabled = Sebelum Me.btBerikut.Enabled = Berikut
Else Me.btSebelum.Enabled = False
Me.btBerikut.Enabled = False End If
Me.Repaint KeluarSub:
Exit Sub SalahBookmark:
Resume KeluarSub End Sub
Form Edit Kebun
VBA Script Option Compare Database
Private Sub btSebelum_Click On Error GoTo Err_btSebelum_Click
Me.btBerikut.Enabled = True DoCmd.GoToRecord , , acPrevious
Exit_btSebelum_Click: Exit Sub
Err_btSebelum_Click: MsgBox First Record, , Me.Caption
Resume Exit_btSebelum_Click End Sub
Private Sub btBerikut_Click On Error GoTo Err_btBerikut_Click
Me.btSebelum.Enabled = True DoCmd.GoToRecord , , acNext
Exit_btBerikut_Click: Exit Sub
Err_btBerikut_Click:
MsgBox Last Record, , Me.Caption Resume Exit_btBerikut_Click
End Sub Private Sub btKeluar_Click
On Error GoTo Err_btKeluar_Click Tutup
DoCmd.Close acForm, Me.Name Exit_btKeluar_Click:
Exit Sub Err_btKeluar_Click:
MsgBox Err.Description, , Me.Caption Resume Exit_btKeluar_Click
End Sub Private Sub Combo25_AfterUpdate
Find the record that matches the control. Dim rs As Object
Set rs = Me.Recordset.Clone rs.FindFirst [ID] = StrNzMe[Combo25], 0
If Not rs.EOF Then Me.Bookmark = rs.Bookmark End Sub
Private Sub Form_Current On Error GoTo SalahBookmark
Dim rs As DAO.Recordset Dim Sebelum As Boolean
Dim Berikut As Boolean Set rs = Me.RecordsetClone
If rs.RecordCount 0 Then rs.Bookmark = Me.Bookmark
TombolNav rs, Sebelum, Berikut Me.btSebelum.Enabled = Sebelum
Me.btBerikut.Enabled = Berikut Else
Me.btSebelum.Enabled = False Me.btBerikut.Enabled = False
End If Me.Repaint
KeluarSub: Exit Sub
SalahBookmark: Resume KeluarSub
End Sub Private Sub KAPASITAS_AfterUpdate
Me.PEMBILX = Me.KAPASITAS Me.X Me.PEMBILY = Me.KAPASITAS Me.Y
End Sub Form Edit Pabrik
VBA Script Option Compare Database
Private Sub btSebelum_Click On Error GoTo Err_btSebelum_Click
Me.btBerikut.Enabled = True DoCmd.GoToRecord , , acPrevious
Exit_btSebelum_Click: Exit Sub
Err_btSebelum_Click: MsgBox First Record, , Me.Caption
Resume Exit_btSebelum_Click End Sub
Private Sub btBerikut_Click On Error GoTo Err_btBerikut_Click
Me.btSebelum.Enabled = True DoCmd.GoToRecord , , acNext
Exit_btBerikut_Click: Exit Sub
Err_btBerikut_Click: MsgBox Last Record, , Me.Caption
Resume Exit_btBerikut_Click End Sub
Private Sub btKeluar_Click On Error GoTo Err_btKeluar_Click
Tutup DoCmd.Close acForm, Me.Name
Exit_btKeluar_Click: Exit Sub
Err_btKeluar_Click: MsgBox Err.Description, , Me.Caption
Resume Exit_btKeluar_Click End Sub
Private Sub Combo21_AfterUpdate Find the record that matches the control.
Dim rs As Object Set rs = Me.Recordset.Clone
rs.FindFirst [ID] = StrNzMe[Combo21], 0 If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub Private Sub Form_Current
On Error GoTo SalahBookmark Dim rs As DAO.Recordset
Dim Sebelum As Boolean Dim Berikut As Boolean
Set rs = Me.RecordsetClone If rs.RecordCount 0 Then
rs.Bookmark = Me.Bookmark TombolNav rs, Sebelum, Berikut
Me.btSebelum.Enabled = Sebelum Me.btBerikut.Enabled = Berikut
Else Me.btSebelum.Enabled = False
Me.btBerikut.Enabled = False
End If Me.Repaint
KeluarSub: Exit Sub
SalahBookmark: Resume KeluarSub
End Sub Form Kalkulasi Alokasi
VBA Script Option Compare Database
Private Sub btProses_Click Dim rs1 As DAO.Recordset
Dim rs2 As DAO.Recordset Dim rs3 As DAO.Recordset
Dim rs4 As DAO.Recordset Dim dbs As DAO.Database
Dim vThnSmp As Double Dim vThnJln As Double
Dim i As Integer Dim j As Long
Dim k As Long Dim l As Integer
Dim nRec As Long Dim nPabrik As Integer
Dim nKebun As Integer Dim x As Integer
Dim y As Integer Dim SisaPKS As Double
Dim SisaKKS As Double Dim Tempatkan As Double
Dim nPKS As Integer Dim nKKS As Integer
Dim vpersen As Double Dim AlokasiPKS As Double
Dim AlokasiKKS As Double Dim Obj As New Excel.Application
Dim wrkBook As Excel.Workbook Dim wrkSheet As Excel.Worksheet
Dim stJudul As String
Dim vBaris As Long Dim NoKolom As Integer
Dim vSheet As Integer Dim Kol1 As Integer
Dim Kol2 As Integer Dim BrsTerakhir As Long
Dim Benar As Boolean Kalkulasi Alokasi
vThnJln = ValMe.ThnMulai Set dbs = Application.CurrentDb
Set rs1 = dbs.OpenRecordsetSELECT rute.EVT_LABEL AS KKS, rute.FAC_LABEL AS PKS, rute.COST _
FROM rute _ ORDER BY rute.COST;
If rs1.RecordCount 0 Then rs1.MoveLast
nRec = rs1.RecordCount Set rs2 = dbs.OpenRecordsetselect from kks_node;
If rs2.RecordCount 0 Then rs2.MoveLast
nKebun = rs2.RecordCount ReDim AlokasiKKSnKebun
End If Set rs3 = dbs.OpenRecordsetselect from pks;
If rs3.RecordCount 0 Then rs3.MoveLast
nPabrik = rs3.RecordCount ReDim AlokasiPKSnPabrik
End If Kosongkan:
Set rs2 = dbs.OpenRecordsetselect from tbAlokasi _
order by tahun, kebun, pabrik If rs2.RecordCount 0 Then
rs2.MoveFirst i = 0
On Error Resume Next While Not rs2.EOF
i = i + 1 rs2.Delete
If Err.Number 0 Then For j = 1 To 10000
Next i = 0
GoTo Kosongkan
End If rs2.MoveNext
If i Mod 1500 = 0 Then For j = 1 To 10000
Next i = 0
End If Wend
For j = 1 To 10000 Next
End If While vThnJln = Me.ThnSampai
j = 0 For i = 1 To nPabrik
AlokasiPKSi = 0 Next
For i = 1 To nKebun AlokasiKKSi = 0
Next rs1.MoveFirst
j = 0 l = 0
For x = 1 To nKebun For y = 1 To nPabrik
l = l + 1 rs2.AddNew
rs2[tahun] = vThnJln rs2[kebun] = KKS Formatx, 000
rs2[pabrik] = PKS Formaty, 000 rs2[alokasi] = 0
rs2.Update If l Mod 500 = 0 Then
l = 0 For k = 1 To 10000
Next End If
Next Next
Set rs3 = dbs.OpenRecordsetSELECT FROM kapkks _
WHEREtahun= vThnJln _ ORDER BY kebun;
Set rs4 = dbs.OpenRecordsetSELECT FROM kappks _
WHEREtahun= vThnJln _ ORDER BY pabrik;
While Not rs1.EOF j = j + 1
If Intj nRec 10000 vpersen Then vpersen = Intj nRec 10000
Me.indikator.Width = vpersen 10000 Me.wadah.Width
Me.Label17.Caption = Kalkulasi tahun FormatvThnJln, 0000 : Formatvpersen 10000,
Percent Me.Repaint
End If rs3.FindFirst [kebun]= rs1[KKS]
rs4.FindFirst [pabrik]= rs1[pks] nPKS = ValRightrs1[pks], 3
nKKS = ValRightrs1[KKS], 3 SisaPKS = rs4[kappabrik] - AlokasiPKSnPKS
SisaKKS = rs3[kapkebun] - AlokasiKKSnKKS Tempatkan = 0
If SisaPKS 0 Then If SisaPKS = SisaKKS Then
Tempatkan = SisaKKS Else
Tempatkan = SisaPKS End If
Else Tempatkan = 0
End If AlokasiPKSnPKS = AlokasiPKSnPKS + Tempatkan
AlokasiKKSnKKS = AlokasiKKSnKKS + Tempatkan rs2.FindFirst [tahun] [kebun] [pabrik]=
vThnJln rs1[KKS] rs1[pks] If rs2.NoMatch Then
Else rs2.Edit
rs2[alokasi] = Tempatkan rs2.Update
End If If j Mod 500 = 0 Then
For k = 1 To 10000 Next
End If rs1.MoveNext
Wend vThnJln = vThnJln + 1
Wend End If
Laporan Alokasi
Set
rs1 =
dbs.OpenRecordsetSELECT tbAlokasi.tahun,
tbAlokasi.kebun, tbAlokasi.pabrik,
rute.COST, tbAlokasi.alokasi _
FROM rute INNER JOIN tbAlokasi ON rute.FAC_LABEL = tbAlokasi.pabrik AND rute.EVT_LABEL = tbAlokasi.kebun
_
ORDER BY
tbAlokasi.tahun, tbAlokasi.kebun,
tbAlokasi.pabrik; If rs1.RecordCount 0 Then
On Error Resume Next Set Obj = GetObject, Excel.Application
If Err.Number 0 Then Set Obj = CreateObjectexcel.application
End If rs1.MoveLast
nRec = rs1.RecordCount Set wrkBook = Obj.Workbooks.Add
Set wrkSheet = wrkBook.ActiveSheet wrkSheet.Name = ALOKASI
vBaris = 5 wrkSheet.CellsvBaris, 1 = Dari
wrkSheet.CellsvBaris, 2 = Tujuan wrkSheet.CellsvBaris, 3 = Biaya per Ton
wrkSheet.CellsvBaris, 4 = Alokasi dan Biaya vBaris = vBaris + 1
NoKolom = 3 For k = Me.ThnMulai To Me.ThnSampai
NoKolom = NoKolom + 1 Kol1 = k - Me.ThnMulai 2 + 4
Kol2 = k - Me.ThnMulai 2 + 4 + 1 wrkSheet.CellsvBaris, k - Me.ThnMulai 2 + 4 =
k wrkSheet.CellsvBaris + 1, Kol1 = Alokasi
wrkSheet.CellsvBaris + 1, Kol2 = Biaya wrkSheet.RangecolHurufKol1 TrimStrvBaris
: colHurufKol2 TrimStrvBaris.MergeCells = True Next
wrkSheet.RangeA5:A7.MergeCells = True wrkSheet.RangeB5:B7.MergeCells = True
wrkSheet.RangeC5:C7.MergeCells = True wrkSheet.RangeD5:
colHurufMe.ThnSampai -
Me.ThnMulai 2 + 5 5.MergeCells = True vBaris = vBaris + 2
For j = 1 To Me.ThnSampai - Me.ThnMulai 2 + 6 wrkSheet.CellsvBaris, j = j
Next With wrkSheet.RangeA5: colHurufKol2 8
.HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter
.Font.Size = 12 .Font.Bold = True
.WrapText = True End With
NoKolom = 4 rs1.MoveFirst
j = 0 k = 0
While Not rs1.EOF j = j + 1
If Intj nRec 10000 vpersen Then vpersen = Intj nRec 10000
Me.indikator.Width =
vpersen 10000
Me.wadah.Width Me.Label17.Caption = Laporan Alokasi :
Formatvpersen 10000, Percent Me.Repaint
End If If k rs1[tahun] Then
k = rs1[tahun] vBaris = 8
End If vBaris = vBaris + 1
wrkSheet.CellsvBaris, 1 = rs1[kebun] wrkSheet.CellsvBaris, 2 = rs1[pabrik]
wrkSheet.CellsvBaris, 3 = rs1[COST] wrkSheet.CellsvBaris, rs1[tahun] - Me.ThnMulai
2 + NoKolom = rs1[alokasi] wrkSheet.CellsvBaris, rs1[tahun] - Me.ThnMulai
2 + NoKolom + 1 = = colHurufrs1[tahun] - Me.ThnMulai 2 + NoKolom TrimStrvBaris C
TrimStrvBaris wrkSheet.CellsvBaris, Me.ThnSampai - Me.ThnMulai
2 + 6 = =sumD TrimStrvBaris : colHurufMe.ThnSampai
- Me.ThnMulai
2 +
5 TrimStrvBaris
rs1.MoveNext Wend
wrkSheet.RangeA8:
colHurufMe.ThnSampai -
Me.ThnMulai 2
+ 6
TrimStrvBaris.Sort Key1:=RangecolHurufMe.ThnSampai - Me.ThnMulai 2 + 6
8, Order1:=xlDescending, Header:=xlGuess, _ OrderCustom:=1,
MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal vBaris = vBaris + 1
wrkSheet.Range8:8.AutoFilter For k = Me.ThnMulai To Me.ThnSampai
wrkSheet.CellsvBaris, NoKolom + k - Me.ThnMulai 2 = =SUBTOTAL9, colHurufNoKolom + k - Me.ThnMulai
2 7: colHurufNoKolom + k - Me.ThnMulai 2 TrimStrvBaris - 1
wrkSheet.CellsvBaris, NoKolom + k - Me.ThnMulai 2 + 1 = =SUBTOTAL9, colHurufNoKolom + k -
Me.ThnMulai 2 + 1 7: colHurufNoKolom + k - Me.ThnMulai 2 + 1 TrimStrvBaris - 1
Next With wrkSheet.RangeA TrimStrvBaris :C
TrimStrvBaris .MergeCells = True
.HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter
.Font.Bold = True End With
wrkSheet.RangeC9: colHurufNoKolom
+ k
- Me.ThnMulai 2 - 1 TrimStrvBaris.NumberFormat =
_ ,0_;_ ,0;_ -_;__ wrkSheet.ColumnsA:
colHurufNoKolom +
k -
Me.ThnMulai 2 - 1.EntireColumn.AutoFit wrkSheet.RangeA5:
colHurufNoKolom +
k -
Me.ThnMulai 2 - 1 TrimStrvBaris.Borders.Weight = Excel.XlBorderWeight.xlThin
wrkSheet.CellsvBaris, 1 = Total Sisa kapasitas Kebun
Set
wrkSheet =
wrkBook.Sheets.AddAfter:=SheetsSheets.Count wrkSheet.Name = SISA-KAPASITAS-KKS
Set rs2 = dbs.OpenRecordsetSELECT tbAlokasi.tahun, tbAlokasi.kebun,
kks_node.PERUSAHAAN, kapkks.kapkebun,
SumtbAlokasi.alokasi AS dialokasikan _ FROM kks_node INNER JOIN kapkks INNER JOIN
tbAlokasi ON
kapkks.tahun =
tbAlokasi.tahun AND
kapkks.kebun =
tbAlokasi.kebun ON
kks_node.KODE =
kapkks.kebun _ GROUP
BY tbAlokasi.tahun,
tbAlokasi.kebun, kks_node.PERUSAHAAN, kapkks.kapkebun _
ORDER BY tbAlokasi.tahun, tbAlokasi.kebun; If rs2.RecordCount 0 Then
rs2.MoveLast nRec = rs2.RecordCount
rs2.MoveFirst j = 0
k = 0 wrkSheet.Cells4, 1 = Kebun
wrkSheet.Cells4, 3 = Tahun wrkSheet.Cells5, 1 = Kode
wrkSheet.Cells5, 2 = Perusahaan wrkSheet.RangeA4:B4.MergeCells = True
wrkSheet.RangeC4:
colHurufMe.ThnSampai -
Me.ThnMulai 3 + 5 4.MergeCells = True wrkSheet.RangeA5:A6.MergeCells = True
wrkSheet.RangeB5:B6.MergeCells = True For k = Me.ThnMulai To Me.ThnSampai
wrkSheet.Cells5, k - Me.ThnMulai 3 + 3 = k
wrkSheet.Cells6, k - Me.ThnMulai 3 + 3 = Kapasitas
wrkSheet.Cells6, k - Me.ThnMulai 3 + 4 = Alokasi
wrkSheet.Cells6, k - Me.ThnMulai 3 + 5 = Sisa
wrkSheet.RangecolHurufk - Me.ThnMulai 3 + 3 5: colHurufk - Me.ThnMulai 3 + 5
5.MergeCells = True Next
With
wrkSheet.RangeA4: colHurufk
- Me.ThnMulai 3 + 5 6
.HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter
.Font.Size = 12 .Font.Bold = True
End With vBaris = 6
While Not rs2.EOF j = j + 1
If Intj nRec 10000 vpersen Then vpersen = Intj nRec 10000
Me.indikator.Width = vpersen 10000 Me.wadah.Width
Me.Label17.Caption = Laporan Sisa Kapasitas KKS : Formatvpersen 10000, Percent
Me.Repaint End If
If k rs2[tahun] Then k = rs2[tahun]
vBaris = 6 End If
vBaris = vBaris + 1 wrkSheet.CellsvBaris, 1 = rs2[kebun]
If IsNullrs2[PERUSAHAAN] Then wrkSheet.CellsvBaris, 2 = na
Else wrkSheet.CellsvBaris, 2 = rs2[PERUSAHAAN]
End If wrkSheet.CellsvBaris, k - Me.ThnMulai 3 +
3 = rs2[kapkebun] wrkSheet.CellsvBaris, k - Me.ThnMulai 3 +
4 = rs2[dialokasikan] wrkSheet.CellsvBaris, k - Me.ThnMulai 3 +
5 = = colHurufk - Me.ThnMulai 3 + 3 TrimStrvBaris - colHurufk - Me.ThnMulai 3 +
4 TrimStrvBaris rs2.MoveNext
Wend vBaris = vBaris + 1
With wrkSheet.RangeA TrimStrvBaris :B TrimStrvBaris
.MergeCells = True
.HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter
.Font.Bold = True End With
wrkSheet.CellsvBaris, 1 = Total For k = Me.ThnMulai To Me.ThnSampai
wrkSheet.CellsvBaris, k - Me.ThnMulai 3 + 3 = =sum colHurufk - Me.ThnMulai 3 + 3 7:
colHurufk - Me.ThnMulai 3 + 3 TrimStrvBaris - 1 wrkSheet.CellsvBaris, k - Me.ThnMulai 3 +
4 = =sum colHurufk - Me.ThnMulai 3 + 4 7: colHurufk - Me.ThnMulai 3 + 4 TrimStrvBaris - 1
wrkSheet.CellsvBaris, k - Me.ThnMulai 3 + 5 = =sum colHurufk - Me.ThnMulai 3 + 5 7:
colHurufk - Me.ThnMulai 3 + 5 TrimStrvBaris - 1 Next
wrkSheet.RangeB7:
colHurufMe.ThnSampai -
Me.ThnMulai 3 + 5 TrimStrvBaris.NumberFormat = _ ,0_;_ ,0;_ -_;__
wrkSheet.ColumnsA: colHurufMe.ThnSampai - Me.ThnMulai 3 + 5.EntireColumn.AutoFit
wrkSheet.RangeA4:
colHurufMe.ThnSampai -
Me.ThnMulai 3 + 5 TrimStrvBaris.Borders.Weight = Excel.XlBorderWeight.xlThin
End If Sisa SISA-DEMAND-PKS
Set
wrkSheet =
wrkBook.Sheets.AddAfter:=SheetsSheets.Count wrkSheet.Name = SISA-DEMAND-PKS
Set rs2 = dbs.OpenRecordsetSELECT tbAlokasi.tahun, tbAlokasi.pabrik,
pks.PERUSAHAAN, kappks.kappabrik,
SumtbAlokasi.alokasi AS dialokasikan _ FROM pks INNER JOIN kappks INNER JOIN tbAlokasi
ON kappks.pabrik = tbAlokasi.pabrik AND kappks.tahun = tbAlokasi.tahun ON pks.KODE = kappks.pabrik _
GROUP BY
tbAlokasi.tahun, tbAlokasi.pabrik,
pks.PERUSAHAAN, kappks.kappabrik _ ORDER BY tbAlokasi.tahun, tbAlokasi.pabrik;
If rs2.RecordCount 0 Then rs2.MoveLast
nRec = rs2.RecordCount rs2.MoveFirst
j = 0 k = 0
wrkSheet.Cells4, 1 = Pabrik wrkSheet.Cells4, 3 = Tahun
wrkSheet.Cells5, 1 = Kode wrkSheet.Cells5, 2 = Perusahaan
wrkSheet.RangeA4:B4.MergeCells = True wrkSheet.RangeC4:
colHurufMe.ThnSampai -
Me.ThnMulai 3 + 5 4.MergeCells = True wrkSheet.RangeA5:A6.MergeCells = True
wrkSheet.RangeB5:B6.MergeCells = True For k = Me.ThnMulai To Me.ThnSampai
wrkSheet.Cells5, k - Me.ThnMulai 3 + 3 = k wrkSheet.Cells6, k - Me.ThnMulai 3 + 3 =
Demand wrkSheet.Cells6, k - Me.ThnMulai 3 + 4 =
Alokasi wrkSheet.Cells6, k - Me.ThnMulai 3 + 5 =
Sisa wrkSheet.RangecolHurufk - Me.ThnMulai 3 +
3 5: colHurufk - Me.ThnMulai 3 + 5 5.MergeCells = True
Next With
wrkSheet.RangeA4: colHurufk
- Me.ThnMulai 3 + 5 6
.HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter
.Font.Size = 12 .Font.Bold = True
End With vBaris = 6
While Not rs2.EOF j = j + 1
If Intj nRec 10000 vpersen Then vpersen = Intj nRec 10000
Me.indikator.Width = vpersen 10000 Me.wadah.Width
Me.Label17.Caption = Laporan Sisa Demand PKS : Formatvpersen 10000, Percent
Me.Repaint End If
If k rs2[tahun] Then k = rs2[tahun]
vBaris = 6 End If
vBaris = vBaris + 1 wrkSheet.CellsvBaris, 1 = rs2[pabrik]
If IsNullrs2[PERUSAHAAN] Then wrkSheet.CellsvBaris, 2 = na
Else wrkSheet.CellsvBaris, 2 = rs2[PERUSAHAAN]
End If wrkSheet.CellsvBaris, k - Me.ThnMulai 3 +
3 = rs2[kappabrik] wrkSheet.CellsvBaris, k - Me.ThnMulai 3 +
4 = rs2[dialokasikan]
wrkSheet.CellsvBaris, k - Me.ThnMulai 3 + 5 = = colHurufk - Me.ThnMulai 3 + 3
TrimStrvBaris - colHurufk - Me.ThnMulai 3 + 4 TrimStrvBaris
rs2.MoveNext Wend
vBaris = vBaris + 1 With wrkSheet.RangeA TrimStrvBaris :B
TrimStrvBaris .MergeCells = True
.HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter
.Font.Bold = True End With
wrkSheet.CellsvBaris, 1 = Total For k = Me.ThnMulai To Me.ThnSampai
wrkSheet.CellsvBaris, k - Me.ThnMulai 3 + 3 = =sum colHurufk - Me.ThnMulai 3 + 3 7:
colHurufk - Me.ThnMulai 3 + 3 TrimStrvBaris - 1 wrkSheet.CellsvBaris, k - Me.ThnMulai 3 +
4 = =sum colHurufk - Me.ThnMulai 3 + 4 7: colHurufk - Me.ThnMulai 3 + 4 TrimStrvBaris - 1
wrkSheet.CellsvBaris, k - Me.ThnMulai 3 + 5 = =sum colHurufk - Me.ThnMulai 3 + 5 7:
colHurufk - Me.ThnMulai 3 + 5 TrimStrvBaris - 1 Next
wrkSheet.RangeB7:
colHurufMe.ThnSampai -
Me.ThnMulai 3 + 5 TrimStrvBaris.NumberFormat = _ ,0_;_ ,0;_ -_;__
wrkSheet.ColumnsA: colHurufMe.ThnSampai - Me.ThnMulai 3 + 5.EntireColumn.AutoFit
wrkSheet.RangeA4:
colHurufMe.ThnSampai -
Me.ThnMulai 3 + 5 TrimStrvBaris.Borders.Weight = Excel.XlBorderWeight.xlThin
End If Set rs1 = dbs.OpenRecordsetSELECT tbAlokasi.kebun,
tbAlokasi.pabrik _ FROM tbAlokasi _
GROUP BY tbAlokasi.kebun, tbAlokasi.pabrik _ HAVING SumtbAlokasi.alokasi0 _
ORDER BY tbAlokasi.pabrik, tbAlokasi.kebun; If rs1.RecordCount 0 Then
rs1.MoveFirst Set
rs2 =
dbs.OpenRecordsetSELECT FROM
PENAMPUN; i = 0
While Not rs1.EOF i = i + 1
rs2.FindFirst [ID] = i If rs2.NoMatch Then
rs2.AddNew rs2[ID] = i
rs2[dari] = rs1[kebun] rs2[tujuan] = rs1[pabrik]
rs2.Update Else
rs2.Edit rs2[dari] = rs1[kebun]
rs2[tujuan] = rs1[pabrik] rs2.Update
End If rs1.MoveNext
Wend End If
wrkBook.SheetsAlokasi.Activate Set wrkSheet = wrkBook.ActiveSheet
wrkSheet.RangeH:H.Delete shift:=xlToLeft MsgBox Selesai, vbInformation, Perhatian
Obj.Visible = True Set wrkSheet = Nothing
Set wrkBook = Nothing Set Obj = Nothing
End If End Sub
Private Sub Form_Close Dim rs2 As DAO.Recordset
Dim dbs As DAO.Database Dim i As Long
Dim j As Long Set dbs = Application.CurrentDb
BKNKSG: Set rs2 = dbs.OpenRecordsetselect from tbAlokasi
_ order by tahun, kebun, pabrik
If rs2.RecordCount 0 Then rs2.MoveFirst
i = 0 On Error Resume Next
While Not rs2.EOF i = i + 1
rs2.Delete If Err.Number 0 Then
For j = 1 To 10000 Next
i = 0 GoTo BKNKSG
End If
rs2.MoveNext If i Mod 1500 = 0 Then
For j = 1 To 10000 Next
i = 0 End If
Wend For j = 1 To 10000
Next End If
Pesu End Sub
Private Sub Form_OpenCancel As Integer Dim rs As DAO.Recordset
Dim dbs As DAO.Database Dim Txt As String
Dim Ket As String Set dbs = Application.CurrentDb
Set
rs =
dbs.OpenRecordsetSELECT kapkks.tahun,
Sumkapkks.kapkebun AS SumOfkapkebun _ FROM kapkks _
GROUP BY kapkks.tahun _ ORDER BY kapkks.tahun;
If rs.RecordCount 0 Then rs.MoveFirst
Txt = = rs[tahun] Ket = Nilai harus dari tahun rs[tahun]
Me.ThnMulai.DefaultValue = rs[tahun] Me.ThnSampai.DefaultValue = rs[tahun] + 1
rs.MoveLast Txt = Txt and = rs[tahun]
Ket = Ket , sampai dengan tahun rs[tahun] Me.ThnMulai.ValidationRule = Txt
Me.ThnMulai.ValidationText = Ket Else
Me.ThnMulai.DefaultValue = Me.ThnMulai.ValidationRule =
Me.ThnMulai.ValidationText = End If
Me.Label17.Caption = Siaga... Me.Label17.Visible = True
Me.indikator.Width = 0 Me.Repaint
End Sub Private Sub ThnMulai_AfterUpdate
If Me.ThnSampai Me.ThnMulai Then Me.ThnSampai = Me.ThnMulai
Me.Label17.Caption = Siaga...
End If Me.Label17.Visible = True
Me.indikator.Width = 0 Me.Repaint
End Sub Private Sub ThnSampai_AfterUpdate
Me.Label17.Visible = True Me.indikator.Width = 0
Me.Repaint End Sub
From Kalkulasi Alokasi dari Pabrik ke Dermaga
VBA Script Option Compare Database
Private Sub btProses_Click Dim rs1 As DAO.Recordset
Dim rs2 As DAO.Recordset Dim rs3 As DAO.Recordset
Dim rs4 As DAO.Recordset Dim dbs As DAO.Database
Dim vThnSmp As Double Dim vThnJln As Double
Dim I As Integer Dim J As Long
Dim k As Long Dim l As Integer
Dim nRec As Long Dim nDermaga As Integer
Dim nPabrik As Integer Dim x As Integer
Dim y As Integer Dim SisaPKS As Double
Dim SisaLKI As Double Dim Tempatkan As Double
Dim nPKS As Integer Dim nLKI As Integer
Dim vpersen As Double Dim AlokasiDer As Double
Dim AlokasiPKS As Double Dim Obj As New Excel.Application
Dim wrkBook As Excel.Workbook Dim wrkSheet As Excel.Worksheet
Dim stJudul As String Dim vBaris As Long
Dim NoKolom As Integer Dim vSheet As Integer
Dim Kol1 As Integer Dim Kol2 As Integer
Kalkulasi Alokasi Set dbs = Application.CurrentDb
If IsNullMe.Combo5 Then Set rs1 = dbs.OpenRecordsetSELECT rute.EVT_LABEL AS
PKS, rute.FAC_LABEL AS Dermaga, rute.COST _ FROM rute _
ORDER BY rute.COST; Else
Set rs1 = dbs.OpenRecordsetSELECT rute.EVT_LABEL AS PKS, rute.FAC_LABEL AS Dermaga, rute.COST _
FROM rute _ WHERErute.FAC_LABEL= Me.Combo5 _
ORDER BY rute.COST; End If
vThnJln = ValMe.ThnMulai If rs1.RecordCount 0 Then
rs1.MoveLast nRec = rs1.RecordCount
Set rs2 = dbs.OpenRecordsetselect from pks; If rs2.RecordCount 0 Then
rs2.MoveLast nPabrik = rs2.RecordCount
ReDim AlokasiPKSnPabrik End If
Set rs3 = dbs.OpenRecordsetselect from dermaga; If rs3.RecordCount 0 Then
rs3.MoveLast nDermaga = rs3.RecordCount
ReDim AlokasiDernDermaga End If
Kosongkan: Set rs2 = dbs.OpenRecordsetselect from tbAlokasi
_ order by tahun, pabrik, dermaga
If rs2.RecordCount 0 Then rs2.MoveFirst
I = 0 On Error Resume Next
While Not rs2.EOF I = I + 1
rs2.Delete If Err.Number 0 Then
For J = 1 To 10000 Next
I = 0 GoTo Kosongkan
End If rs2.MoveNext
If I Mod 1500 = 0 Then For J = 1 To 10000
Next I = 0
End If Wend
For J = 1 To 10000 Next
End If While vThnJln = Me.ThnSampai
J = 0 For I = 1 To nDermaga
AlokasiDerI = 0 Next
For I = 1 To nPabrik AlokasiPKSI = 0
Next rs1.MoveFirst
J = 0 l = 0
For x = 1 To nPabrik For y = 1 To nDermaga
l = l + 1 rs2.AddNew
rs2[tahun] = vThnJln rs2[pabrik] = PKS Formatx, 000
rs2[dermaga] = LKI Formaty, 000 rs2[alokasi] = 0
rs2.Update If l Mod 500 = 0 Then
l = 0 For k = 1 To 10000
Next End If
Next Next
Set rs3 = dbs.OpenRecordsetSELECT FROM kappks _
WHEREtahun= vThnJln _ ORDER BY pabrik;
Set rs4 = dbs.OpenRecordsetSELECT FROM kapder _
WHEREtahun= vThnJln _ ORDER BY dermaga;
While Not rs1.EOF J = J + 1
If IntJ nRec 10000 vpersen Then vpersen = IntJ nRec 10000
Me.indikator.Width = vpersen 10000 Me.wadah.Width
Me.Label17.Caption = Kalkulasi tahun FormatvThnJln, 0000 : Formatvpersen 10000,
Percent Me.Repaint
End If rs3.FindFirst [pabrik]= rs1[pks]
rs4.FindFirst [dermaga]= rs1[dermaga] nPKS = ValRightrs1[pks], 3
nLKI = ValRightrs1[dermaga], 3 SisaLKI = rs4[kapdermaga] - AlokasiDernLKI
SisaPKS = rs3[kappabrik] - AlokasiPKSnPKS Tempatkan = 0
If SisaLKI 0 Then If SisaLKI = SisaPKS Then
Tempatkan = SisaPKS Else
Tempatkan = SisaLKI End If
Else Tempatkan = 0
End If AlokasiDernLKI = AlokasiDernLKI + Tempatkan
AlokasiPKSnPKS = AlokasiPKSnPKS + Tempatkan rs2.FindFirst [tahun] [pabrik] [dermaga]=
vThnJln rs1[pks] rs1[dermaga] If rs2.NoMatch Then
Else rs2.Edit
rs2[alokasi] = Tempatkan rs2.Update
End If If J Mod 500 = 0 Then
For k = 1 To 10000 Next
End If rs1.MoveNext
Wend vThnJln = vThnJln + 1
Wend End If
Laporan Alokasi
Set
rs1 =
dbs.OpenRecordsetSELECT tbAlokasi.tahun,
tbAlokasi.pabrik, tbAlokasi.dermaga,
rute.COST, tbAlokasi.alokasi _
FROM rute INNER JOIN tbAlokasi ON rute.FAC_LABEL = tbAlokasi.dermaga AND rute.EVT_LABEL = tbAlokasi.pabrik
_
ORDER BY
tbAlokasi.tahun, tbAlokasi.pabrik,
tbAlokasi.dermaga; If rs1.RecordCount 0 Then
On Error Resume Next Set Obj = GetObject, Excel.Application
If Err.Number 0 Then Set Obj = CreateObjectexcel.application
End If rs1.MoveLast
nRec = rs1.RecordCount Set wrkBook = Obj.Workbooks.Add
Set wrkSheet = wrkBook.ActiveSheet wrkSheet.Name = Alokasi
vBaris = 5 wrkSheet.CellsvBaris, 1 = Dari
wrkSheet.CellsvBaris, 2 = Tujuan wrkSheet.CellsvBaris, 3 = Biaya per Ton
wrkSheet.CellsvBaris, 4 = Alokasi dan Biaya vBaris = vBaris + 1
NoKolom = 3 For k = Me.ThnMulai To Me.ThnSampai
NoKolom = NoKolom + 1 Kol1 = k - Me.ThnMulai 2 + 4
Kol2 = k - Me.ThnMulai 2 + 4 + 1 wrkSheet.CellsvBaris, k - Me.ThnMulai 2 + 4 =
k wrkSheet.CellsvBaris + 1, Kol1 = Alokasi
wrkSheet.CellsvBaris + 1, Kol2 = Biaya wrkSheet.RangecolHurufKol1 TrimStrvBaris
: colHurufKol2 TrimStrvBaris.MergeCells = True Next
wrkSheet.RangeA5:A7.MergeCells = True wrkSheet.RangeB5:B7.MergeCells = True
wrkSheet.RangeC5:C7.MergeCells = True wrkSheet.RangeD5:
colHurufMe.ThnSampai -
Me.ThnMulai 2 + 5 5.MergeCells = True vBaris = vBaris + 2
For J = 1 To Me.ThnSampai - Me.ThnMulai 2 + 6 wrkSheet.CellsvBaris, J = J
Next With wrkSheet.RangeA5: colHurufKol2 8
.HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter
.Font.Size = 12 .Font.Bold = True
.WrapText = True End With
NoKolom = 4 rs1.MoveFirst
J = 0 k = 0
While Not rs1.EOF J = J + 1
If IntJ nRec 10000 vpersen Then vpersen = IntJ nRec 10000
Me.indikator.Width
= vpersen
10000 Me.wadah.Width
Me.Label17.Caption = Laporan Alokasi : Formatvpersen 10000, Percent
Me.Repaint End If
If k rs1[tahun] Then k = rs1[tahun]
vBaris = 8 End If
vBaris = vBaris + 1 wrkSheet.CellsvBaris, 1 = rs1[pabrik]
wrkSheet.CellsvBaris, 2 = rs1[dermaga] wrkSheet.CellsvBaris, 3 = rs1[COST]
wrkSheet.CellsvBaris, rs1[tahun] - Me.ThnMulai 2 + NoKolom = rs1[alokasi]
wrkSheet.CellsvBaris, rs1[tahun] - Me.ThnMulai 2 + NoKolom + 1 = = colHurufrs1[tahun] -
Me.ThnMulai 2 + NoKolom TrimStrvBaris C TrimStrvBaris
wrkSheet.CellsvBaris, Me.ThnSampai - Me.ThnMulai 2 + 6 = =sumD TrimStrvBaris :
colHurufMe.ThnSampai
- Me.ThnMulai
2 +
5 TrimStrvBaris
rs1.MoveNext Wend
wrkSheet.RangeA8:
colHurufMe.ThnSampai -
Me.ThnMulai 2
+ 6
TrimStrvBaris.Sort Key1:=RangecolHurufMe.ThnSampai - Me.ThnMulai 2 + 6
8, Order1:=xlDescending, Header:=xlGuess, _ OrderCustom:=1,
MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal vBaris = vBaris + 1
wrkSheet.Range8:8.AutoFilter For k = Me.ThnMulai To Me.ThnSampai
wrkSheet.CellsvBaris, NoKolom + k - Me.ThnMulai 2 = =SUBTOTAL9, colHurufNoKolom + k - Me.ThnMulai
2 9: colHurufNoKolom + k - Me.ThnMulai 2 TrimStrvBaris - 1
wrkSheet.CellsvBaris, NoKolom + k - Me.ThnMulai 2 + 1 = =SUBTOTAL9, colHurufNoKolom + k -
Me.ThnMulai 2 + 1 9: colHurufNoKolom + k - Me.ThnMulai 2 + 1 TrimStrvBaris - 1
Next With wrkSheet.RangeA TrimStrvBaris :C
TrimStrvBaris .MergeCells = True
.HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter
.Font.Bold = True End With
wrkSheet.RangeC9:
colHurufNoKolom +
k -
Me.ThnMulai 2 - 1 TrimStrvBaris.NumberFormat = _ ,0_;_ ,0;_ -_;__
wrkSheet.ColumnsA: colHurufNoKolom
+ k
- Me.ThnMulai 2 - 1.EntireColumn.AutoFit
wrkSheet.RangeA5: colHurufNoKolom
+ k
- Me.ThnMulai 2 - 1 TrimStrvBaris.Borders.Weight =
Excel.XlBorderWeight.xlThin wrkSheet.CellsvBaris, 1 = Total
wrkSheet.RangeH:H.Delete shift:=xlLeft Sisa kapasitas Pabrik
Set
wrkSheet =
wrkBook.Sheets.AddAfter:=SheetsSheets.Count wrkSheet.Name = SISA-KAPASITAS-PKS
Set rs2 = dbs.OpenRecordsetSELECT tbAlokasi.tahun, tbAlokasi.pabrik,
pks.PERUSAHAAN, kappks.kappabrik,
SumtbAlokasi.alokasi AS dialokasikan _ FROM pks INNER JOIN kappks INNER JOIN tbAlokasi
ON kappks.pabrik = tbAlokasi.pabrik AND kappks.tahun = tbAlokasi.tahun ON pks.KODE = kappks.pabrik _
GROUP BY
tbAlokasi.tahun, tbAlokasi.pabrik,
pks.PERUSAHAAN, kappks.kappabrik _ ORDER BY tbAlokasi.tahun, tbAlokasi.pabrik;
If rs2.RecordCount 0 Then rs2.MoveLast
nRec = rs2.RecordCount rs2.MoveFirst
J = 0 k = 0
wrkSheet.Cells4, 1 = Pabrik wrkSheet.Cells4, 3 = Tahun
wrkSheet.Cells5, 1 = Kode wrkSheet.Cells5, 2 = Perusahaan
wrkSheet.RangeA4:B4.MergeCells = True wrkSheet.RangeC4:
colHurufMe.ThnSampai -
Me.ThnMulai 3 + 5 4.MergeCells = True wrkSheet.RangeA5:A6.MergeCells = True
wrkSheet.RangeB5:B6.MergeCells = True For k = Me.ThnMulai To Me.ThnSampai
wrkSheet.Cells5, k - Me.ThnMulai 3 + 3 = k wrkSheet.Cells6, k - Me.ThnMulai 3 + 3 =
Kapasitas wrkSheet.Cells6, k - Me.ThnMulai 3 + 4 =
Alokasi wrkSheet.Cells6, k - Me.ThnMulai 3 + 5 =
Sisa wrkSheet.RangecolHurufk - Me.ThnMulai 3 +
3 5: colHurufk - Me.ThnMulai 3 + 5 5.MergeCells = True
Next With
wrkSheet.RangeA4: colHurufk
- Me.ThnMulai 3 + 5 6
.HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter
.Font.Size = 12 .Font.Bold = True
End With vBaris = 6
While Not rs2.EOF J = J + 1
If IntJ nRec 10000 vpersen Then vpersen = IntJ nRec 10000
Me.indikator.Width = vpersen 10000 Me.wadah.Width
Me.Label17.Caption = Laporan Sisa Kapasitas PKS : Formatvpersen 10000, Percent
Me.Repaint End If
If k rs2[tahun] Then k = rs2[tahun]
vBaris = 6 End If
vBaris = vBaris + 1 wrkSheet.CellsvBaris, 1 = rs2[pabrik]
If IsNullrs2[PERUSAHAAN] Then wrkSheet.CellsvBaris, 2 = na
Else wrkSheet.CellsvBaris, 2 = rs2[PERUSAHAAN]
End If wrkSheet.CellsvBaris, k - Me.ThnMulai 3 +
3 = rs2[kappabrik] wrkSheet.CellsvBaris, k - Me.ThnMulai 3 +
4 = rs2[dialokasikan] wrkSheet.CellsvBaris, k - Me.ThnMulai 3 +
5 = = colHurufk - Me.ThnMulai 3 + 3 TrimStrvBaris - colHurufk - Me.ThnMulai 3 +
4 TrimStrvBaris rs2.MoveNext
Wend
vBaris = vBaris + 1 With wrkSheet.RangeA TrimStrvBaris :B
TrimStrvBaris .MergeCells = True
.HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter
.Font.Bold = True End With
wrkSheet.CellsvBaris, 1 = Total For k = Me.ThnMulai To Me.ThnSampai
wrkSheet.CellsvBaris, k - Me.ThnMulai 3 + 3 = =sum colHurufk - Me.ThnMulai 3 + 3 7:
colHurufk - Me.ThnMulai 3 + 3 TrimStrvBaris - 1 wrkSheet.CellsvBaris, k - Me.ThnMulai 3 +
4 = =sum colHurufk - Me.ThnMulai 3 + 4 7: colHurufk - Me.ThnMulai 3 + 4 TrimStrvBaris - 1
wrkSheet.CellsvBaris, k - Me.ThnMulai 3 + 5 = =sum colHurufk - Me.ThnMulai 3 + 5 7:
colHurufk - Me.ThnMulai 3 + 5 TrimStrvBaris - 1 Next
wrkSheet.RangeB7:
colHurufMe.ThnSampai -
Me.ThnMulai 3 + 5 TrimStrvBaris.NumberFormat = _ ,0_;_ ,0;_ -_;__
wrkSheet.ColumnsA: colHurufMe.ThnSampai - Me.ThnMulai 3 + 5.EntireColumn.AutoFit
wrkSheet.RangeA4:
colHurufMe.ThnSampai -
Me.ThnMulai 3 + 5 TrimStrvBaris.Borders.Weight = Excel.XlBorderWeight.xlThin
End If Sisa SISA-DEMAND-Dermaga Lokasi Kawasan Industri
Set
wrkSheet =
wrkBook.Sheets.AddAfter:=SheetsSheets.Count wrkSheet.Name = SISA-DEMAND-Dermaga
Set rs2 = dbs.OpenRecordsetSELECT tbAlokasi.tahun, tbAlokasi.dermaga,
kapder.kapdermaga, dermaga.Lokasi
AS PERUSAHAAN, SumtbAlokasi.alokasi AS dialokasikan _
FROM dermaga INNER JOIN kapder INNER JOIN tbAlokasi ON kapder.dermaga = tbAlokasi.dermaga AND
kapder.tahun =
tbAlokasi.tahun ON
dermaga.KODE =
kapder.dermaga _ GROUP BY tbAlokasi.tahun, tbAlokasi.dermaga,
kapder.kapdermaga, dermaga.Lokasi _ ORDER BY tbAlokasi.tahun, tbAlokasi.dermaga;
If rs2.RecordCount 0 Then rs2.MoveLast
nRec = rs2.RecordCount
rs2.MoveFirst J = 0
k = 0 wrkSheet.Cells4, 1 = Dermaga
wrkSheet.Cells4, 3 = Tahun wrkSheet.Cells5, 1 = Kode
wrkSheet.Cells5, 2 = Perusahaan wrkSheet.RangeA4:B4.MergeCells = True
wrkSheet.RangeC4:
colHurufMe.ThnSampai -
Me.ThnMulai 3 + 5 4.MergeCells = True wrkSheet.RangeA5:A6.MergeCells = True
wrkSheet.RangeB5:B6.MergeCells = True For k = Me.ThnMulai To Me.ThnSampai
wrkSheet.Cells5, k - Me.ThnMulai 3 + 3 = k wrkSheet.Cells6, k - Me.ThnMulai 3 + 3 =
Demand wrkSheet.Cells6, k - Me.ThnMulai 3 + 4 =
Alokasi wrkSheet.Cells6, k - Me.ThnMulai 3 + 5 =
Sisa wrkSheet.RangecolHurufk - Me.ThnMulai 3 +
3 5: colHurufk - Me.ThnMulai 3 + 5 5.MergeCells = True
Next With
wrkSheet.RangeA4: colHurufk
- Me.ThnMulai 3 + 5 6
.HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter
.Font.Size = 12 .Font.Bold = True
End With vBaris = 6
While Not rs2.EOF J = J + 1
If IntJ nRec 10000 vpersen Then vpersen = IntJ nRec 10000
Me.indikator.Width = vpersen 10000 Me.wadah.Width
Me.Label17.Caption = Laporan Sisa Demand Dermaga : Formatvpersen 10000, Percent
Me.Repaint End If
If k rs2[tahun] Then k = rs2[tahun]
vBaris = 6 End If
vBaris = vBaris + 1 wrkSheet.CellsvBaris, 1 = rs2[dermaga]
If IsNullrs2[PERUSAHAAN] Then wrkSheet.CellsvBaris, 2 = na
Else wrkSheet.CellsvBaris, 2 = rs2[PERUSAHAAN]
End If wrkSheet.CellsvBaris, k - Me.ThnMulai 3 +
3 = rs2[kapdermaga] wrkSheet.CellsvBaris, k - Me.ThnMulai 3 +
4 = rs2[dialokasikan] wrkSheet.CellsvBaris, k - Me.ThnMulai 3 +
5 = = colHurufk - Me.ThnMulai 3 + 3 TrimStrvBaris - colHurufk - Me.ThnMulai 3 +
4 TrimStrvBaris rs2.MoveNext
Wend vBaris = vBaris + 1
With wrkSheet.RangeA TrimStrvBaris :B TrimStrvBaris
.MergeCells = True .HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter .Font.Bold = True
End With wrkSheet.CellsvBaris, 1 = Total
For k = Me.ThnMulai To Me.ThnSampai wrkSheet.CellsvBaris, k - Me.ThnMulai 3 +
3 = =sum colHurufk - Me.ThnMulai 3 + 3 7: colHurufk - Me.ThnMulai 3 + 3 TrimStrvBaris - 1
wrkSheet.CellsvBaris, k - Me.ThnMulai 3 + 4 = =sum colHurufk - Me.ThnMulai 3 + 4 7:
colHurufk - Me.ThnMulai 3 + 4 TrimStrvBaris - 1 wrkSheet.CellsvBaris, k - Me.ThnMulai 3 +
5 = =sum colHurufk - Me.ThnMulai 3 + 5 7: colHurufk - Me.ThnMulai 3 + 5 TrimStrvBaris - 1
Next wrkSheet.RangeB7:
colHurufMe.ThnSampai -
Me.ThnMulai 3 + 5 TrimStrvBaris.NumberFormat = _ ,0_;_ ,0;_ -_;__
wrkSheet.ColumnsA: colHurufMe.ThnSampai - Me.ThnMulai 3 + 5.EntireColumn.AutoFit
wrkSheet.RangeA4:
colHurufMe.ThnSampai -
Me.ThnMulai 3 + 5 TrimStrvBaris.Borders.Weight = Excel.XlBorderWeight.xlThin
End If wrkBook.SheetsAlokasi.Activate
MsgBox Selesai, vbInformation, Perhatian Set rs1 = dbs.OpenRecordsetSELECT tbAlokasi.pabrik,
tbAlokasi.dermaga, SumtbAlokasi.alokasi AS SumOfalokasi _
FROM tbAlokasi _ GROUP BY tbAlokasi.pabrik, tbAlokasi.dermaga _
HAVING SumtbAlokasi.alokasi0; Set rs2 = dbs.OpenRecordsetSELECT FROM penampun;
If rs1.RecordCount 0 Then
rs1.MoveLast I = rs1.RecordCount
rs1.MoveFirst While Not rs1.EOF
rs2.FindFirst
[Dari] [Tujuan]=
rs1[pabrik] rs1[dermaga] If rs2.NoMatch Then
I = I + 1 rs2.AddNew
rs2[ID] = I rs2[dari] = rs1[pabrik]
rs2[tujuan] = rs1[dermaga] rs2.Update
End If rs1.MoveNext
Wend End If
Obj.Visible = True Set wrkSheet = Nothing
Set wrkBook = Nothing Set Obj = Nothing
End If End Sub
Private Sub Form_Close Dim rs2 As DAO.Recordset
Dim dbs As DAO.Database Dim I As Long
Dim J As Long Set dbs = Application.CurrentDb
BKNKSG: Set rs2 = dbs.OpenRecordsetselect from tbAlokasi
_ order by tahun, pabrik, dermaga
If rs2.RecordCount 0 Then rs2.MoveFirst
I = 0 On Error Resume Next
While Not rs2.EOF I = I + 1
rs2.Delete If Err.Number 0 Then
For J = 1 To 10000 Next
I = 0 GoTo BKNKSG
End If rs2.MoveNext
If I Mod 1500 = 0 Then For J = 1 To 10000
Next I = 0
End If Wend
For J = 1 To 10000 Next
End If Pesu
End Sub Private Sub Form_OpenCancel As Integer
Dim rs As DAO.Recordset Dim dbs As DAO.Database
Dim Txt As String Dim Ket As String
Set dbs = Application.CurrentDb Set
rs =
dbs.OpenRecordsetSELECT kappks.tahun,
Sumkappks.kappabrik AS SumOfkappabrik _ FROM kappks _
GROUP BY kappks.tahun _ ORDER BY kappks.tahun;
If rs.RecordCount 0 Then rs.MoveFirst
Txt = = rs[tahun] Ket = Nilai harus dari tahun rs[tahun]
Me.ThnMulai.DefaultValue = rs[tahun] Me.ThnSampai.DefaultValue = rs[tahun] + 1
rs.MoveLast Txt = Txt and = rs[tahun]
Ket = Ket , sampai dengan tahun rs[tahun] Me.ThnMulai.ValidationRule = Txt
Me.ThnMulai.ValidationText = Ket Else
Me.ThnMulai.DefaultValue = Me.ThnMulai.ValidationRule =
Me.ThnMulai.ValidationText = End If
Me.Label17.Caption = Siaga... Me.Label17.Visible = True
Me.indikator.Width = 0 Me.Repaint
End Sub Private Sub ThnMulai_AfterUpdate
If Me.ThnSampai Me.ThnMulai Then Me.ThnSampai = Me.ThnMulai
Me.Label17.Caption = Siaga... End If
Me.Label17.Visible = True Me.indikator.Width = 0
Me.Repaint End Sub
Private Sub ThnSampai_AfterUpdate Me.Label17.Visible = True
Me.indikator.Width = 0 Me.Repaint
End Sub Script Modul di MS Access
Modul Deklarasi Option Compare Database
Option Explicit Public vJudul As String Judul Riport
Public stSource As String String Source SQL
Public stWhereG As String Where Condition Public vPemanggil As String window
Pemanggil Public vSet As String Nomer nota
setting Public arPemanggil6 As String Array window
yang terbuka Modul Umum
Option Compare Database Option Explicit
Sub awal Dim I As Integer
vPemanggil = For I = 0 To 6
arPemanggilI = Next
baru = True End Sub
Sub PanggilvCaller As String Dim I As Integer
Dim StcBaru As String If vCaller = Then
vCaller = Switchboard End If
StcBaru = vCaller If vPemanggil = Then
vPemanggil = StcBaru Else
For I = 0 To 6 If arPemanggilI = Then
arPemanggilI = vPemanggil vPemanggil = StcBaru
Exit For End If
Next End If
Application.Forms.ItemStcBaru.Visible = False End Sub
Sub Tutup Dim I As Integer
Dim lama As String If vPemanggil = Then
lama = Switchboard Else
lama = vPemanggil End If
If lama Then For I = 6 To 0 Step -1
If arPemanggilI Then vPemanggil = arPemanggilI
Exit For End If
Next End If
If I 0 Then I = 0
End If If I - 1 = 0 Then
arPemanggilI = Else
vPemanggil = Switchboard End If
If
Application.CurrentProject.AllForms.Itemlama.IsLoaded Then
Application.Forms.Itemlama.Visible = True Else
DoCmd.OpenForm lama End If
End Sub Sub TombolNavrs As DAO.Recordset, Sebelum As Boolean,
Berikut As Boolean Dim rs1 As DAO.Recordset
Set rs1 = rs.Clone rs1.Bookmark = rs.Bookmark
rs1.MovePrevious Sebelum = Not rs1.BOF
rs1.Bookmark = rs.Bookmark rs1.MoveNext
Berikut = Not rs1.EOF
End Sub Sub Pesu
DoCmd.Quit acQuitSaveAll End Sub
Function ASCIITextTextSumber As String As String Dim I As Integer
ASCIIText = For I = 1 To LenTextSumber
ASCIIText = ASCIIText HexAscMidTextSumber, I, 1 Next
End Function Function HexTextKodeASCII As String As String
Dim I As Integer Dim KodeHexa As String
Dim vHasil As String vHasil =
For I = 1 To LenKodeASCII Step 2 KodeHexa = H MidKodeASCII, I, 2
vHasil = vHasil ChrValKodeHexa Next
HexText = vHasil End Function
Function colHurufI As Integer As String Dim vHuruf As String
Dim Sisa As String vHuruf =
If I 26 Then vHuruf = ChrIntI - 1 26 + 64
End If Sisa = I Mod 26
If Sisa = 0 Then Sisa = 26
End If vHuruf = vHuruf ChrSisa + 64
colHuruf = vHuruf End Function
Lampiran 9 Blok Modul Simulasi