Automate AutoCAD 3D model generation - vba

I want to use AutoCAD to generate a 3D model which is composed of many basic 3D geometries such as sphere, cube, etc.
I have the dimensions and the origin and orientation of the local coordinate system of the basic geometries. The data are stored in an Excel file. Each row of the excel data corresponds to one geometry and the columns are for dimensions, origin coordinates, and orientations. The data format is defined for each type of geometry.
I wanted to use AutoLisp or VBA or some other macro tool for AutoCAD to automate this process so that when the data is changed, I just need to run the macro to read the data and regenerate the AutoCAD 3D model.
What is the best solution?

There is no "best" solution for the general case. If you have experience with AutoLISP, use AutoLISP. If you have and use Visual Studio, use the ObjectARX .NET API. You could also write an Excel macro that generates a simple script file, use VBA inside AutoCAD, or drive AutoCAD from within Excel. The "best" way in your case is whichever way you feel most comfortable with.

Related

How to generate surface mesh from DICOM files and/or nifti file in Python?

I need to generate surface generation from a segmented NIFTI file. I can do that easily in 3D slicer but I want to do that in Python. Is it possible to do that in Python?
I tried using VTK model but it is not showing the Surface rendered output.
check out simpleITK. It has tools that can read in series with full 3d awareness, and also generate various surfaces for you.
It isn't an app that will display things for you however, but there are various examples you can find for how to take the output of simpleITK and use with various visualisation options.
You can do that easily by scripting in 3D Slicer. You don't need to use the graphical user interface, just launch a Python script from the command-line. You can put together the script you need from examples in the script repository (for example https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Export_model_nodes_from_segmentation_node).

How to create image and/or graph in Microsoft Access 2010

I am porting an app over from Delphi (Pascal form with an Access database) to operate strictly in Access. I have already done all the SQL and data handling successfully; now I need to present it graphically. The form features a full-version graph, and then a zoomed-in subset of that graph:
I attempted to reproduce the graph as a CHART, and as an Excel object. (Although I did not succeed with either of these approaches, I acknowledge that the solution may be in there somewhere.)
Ultimately, I did reproduce the full graph (at center right) - but to do so, I had to create hundreds of individual picture elements, and I ran up against the "number of objects limit" before I could complete the "ZOOMBOX"... Clearly the wrong approach.
I have plotted the elements of the graph (a subset of which would, of course, be the zoombox) into a table, which could be used as a sort of "paint-by-numbers" guide.

How can I create shapes in Fusion 360 via API or command line?

I am looking to utilize Autodesk Fusion 360 to generate a huge number of shapes (tens of thousands) in 3D model form, so I need a way to operate it non-interactively.
I am aware of the Fusion 360 API documentation here https://autodeskfusion360.github.io/
But I was wondering if there is a known way to do this.
Essentially there are four main steps to create:
Create base shape (i.e. sphere, cube, trapezoid etc..) and save
Define and name each dimension on the shape as either dependent on another (ex: height/2) or an input (ex: height) until your model is fully constrained and controlled by parameters
Create a program (python is friendly) that inputs values to named inputs
Connect to a database within the program (using odbc or similar) that will iterate through shape characteristics
Input necessary characteristics from database and save unique shape within your program
You will have to be more specific in the question to clarify the answer. Please include as detailed an example as you can and I'll edit my answer.

What tools are commonly used to visualize meteorological and climatological data?

I am interested in visualizing meteorological and climatological data.
Here we are talking about 2D/3D visualization for weather and climate elements:
Temperature
Pressure
Wind
Example
We have used some tools previously, such as:
GrADS
Surfer (commercial software)
GIS Meteo (commercial software)
What another tools (preferably open source) would you suggest for that purpose nowadays?
I know you mentioned GrADS, but it was the tool I used mostly for development of weather products, a little more intuitive and resource friendly than IDV when I coded, and generally pretty good rate of development. You mentioned Open Source... did you know there is an OpenGrADS (http://opengrads.org/)? Most friends involved in weather product development use a combination of GrADS\OpenGrADS for much of their work. But I agree it doesn't produce knock-your-socks-off graphics.
Another commonly used free program is Gempak, another Unidata product, which really seems to be becoming outdated in my personal opinion).
And then you can talk high end graphics, you're going to pay more. http://moe.met.fsu.edu/~hrw22/movies/WIND_Katrina_2005-08-28_00Z.gif is a great video of Katrina that was produced by someone I knew using Amira. According to Wikipedia, you're looking at
"Cost: $4,000 USD + $800/year support (2009)... although now has much more ugly/complex pricing structure where each feature is priced separately (eg: Amira Mesh Option $360). I believe at NCMIR we pay ~$9000/year for five user-license." Ouch!
I don't have an open source tool, but if you can get access to a Level-II data feed (Level-II is minimally post processed radar data), I and a meteorologist friend use GR2Analyst. I would assume you know enough about weather sources to be able to figure out how to set this up.
If you're looking for an open source (and free) tool that can do 2D and 3D, which also includes access to a wide variety of datasets (obs, model output, remote sensing - radar level 2 and 3, satellite, and more!), then you might want to check out the Unidata Integrated Data Viewer (IDV):
http://www.unidata.ucar.edu/software/idv/
Source code available here:
https://github.com/Unidata/IDV
The interface is a bit complex, but we have some youtube screencasts to help people get up and going:
http://www.youtube.com/user/unidatanews/videos
If you'd like to see a video for a specific thing, we are taking requests :-) (email support-idv#unidata.ucar.edu). We do yearly training workshops as well, and those materials are available online here:
http://www.unidata.ucar.edu/software/idv/docs/workshop/
Cheers!
Sean
Panoply is a multiplataform desktop option if data is available in formats such NetCDF, HDF or GRIB.
I extracted the following text from his site that describes some of the characteristics:
Slice and plot geo-gridded latitude-longitude, latitude-vertical, longitude-vertical, or time-latitude arrays from larger multidimensional variables.
Slice and plot "generic" 2D arrays from larger multidimensional variables.
Slice 1D arrays from larger multidimensional variables and create line plots.
Combine two geo-gridded arrays in one plot by differencing, summing or averaging.
Plot lon-lat data on a global or regional map using any of over 100 map projections or make a zonal average line plot.
Overlay continent outlines or masks on lon-lat map plots.
Use any of numerous color tables for the scale colorbar, or apply your own custom ACT, CPT, or RGB color table.
Save plots to disk GIF, JPEG, PNG or TIFF bitmap images or as PDF or PostScript graphics files.
Export lon-lat map plots in KMZ format.
Export animations as AVI or MOV video or as a collection of invididual frame images.
Explore remote THREDDS and OpenDAP catalogs and open datasets served from them.
If you are interested in interactive visualization over web, there are some options such as:
ncWMS: an webmapping server that reads NetCDF data and publish it using Web Mapping Service standard.
GeoServer: another webmapping server that has plugin to read NetCDF data.
Vtk (visualization Toolkit) is a C++ open source 2D and 3D visualization library that I use to visualize radar data in 3D.

Dynamically overlaying vector graphics on a PDF

I have a particular requirement to generate a PDF document with some dynamic data overlaid on top.
That's the general gist. To be clear, I have a fair amount of experience in generating PDFs programatically so I'm not looking for a list of products that can simply churn out PDF.
The specifics are:
I have a pre-existing PDF template containing a vector representation of certain regions of the UK. I will be capturing geographical data via a web interface and will need to overlay these data on the PDF as vector graphics (little circles with numbers to be specific).
So, what I'm looking for is some advice on:
How to dynamically write vector graphics to a PDF
Translation of geographical coordinates to vector layer coordinates
Cheers.
Steve
iText[Sharp] can handle the vector graphics portion fairly easily with a PdfStamper.
There have been several questions on the itext-questions mailing list about geographic coordinates that should help you on that front as well. Searching your favorite list archive for "geospatial" should turn them up.
I don't think we've added higher-level functions for that sort of thing yet, so you'll have to dig into PdfDictionary, PdfArray, and so forth. Keep a copy of the PDF Reference handy (but you probably already do).