Using AutoLISP to select multple copies of an object one by one - autocad

I am trying out AutoLISP for the first time.
In my AutoCAD drawing I have around 300 copies of an object spread at different places.
I want to mirror each object around a fixed axis in middle of the object.
The first roadblock that I am getting is selecting each copy of the object one by one for doing the mirroring operation.
Can anyone help me with that? Is it possible?

You can obtain an selection using the AutoLISP ssget function with an appropriate mode string and filter list argument permitting selection of objects whose properties meet your selection criteria.
If your selection is to be automated with no user input (for example, using the X mode string to query the drawing database), you will need a property by which to distinguish the target objects from other objects in the drawing - this may depend on the type of object that you are looking to select.
For example, you can filter for all objects of the same type using DXF group 0; within the same layout using DXF group 410; residing on the same layer using DXF group 8; or by other properties, such as colour, linetype, or lineweight.
Filters based on the object geometry will be dependent on the type of object that you are looking to target, for example, a selection of circles of the same radius could be acquired by filtering on DXF group 40; or standard (non-dynamic) blocks of the same name using DXF group 2.
Upon obtaining your selection, you'll then need to iterate over the selection such that the mirror operation can be performed on each object individually (since the mirror axis will be different for every object in the selection). To accomplish this, you can choose one of the methods that I describe in my tutorial on Selection Set Processing.

Related

Is there a way to get a picture box to hold a value in VB?

I'm trying to build a game of battleships for my A level course but in all my projects so far have had to create two different arrays one that holds objects and one that hold different variables in a structure... I was wondering if there was any way to combine picture boxes and structures so they can hold more information than just a picture and location such as (in the case of battle ships) its coordinateds in MY grid(not on the screen) and wether its got a ship in it or not...
Thanks in advance

Displaying rectangle based on presence or lack of values in arbitrary column in SSRS

I have a report with multiple sets of data, but only one dataset. I've accomplished this by setting up multiple different columns in my table that SSRS uses. I set up a rectangle that contains a text box header and a tablix; the tablix is filtered on an identification column in the table so it only shows its own data. What I'd like to do is to only show each rectangle if there is applicable data.
I know that I can solve this problem by adding another row in my tablix and moving the text box title into it, and then showing or hiding the tablix based on whether or not it has data. That's probably the smart move. But before I did that, I wondered if there was a way to assign visibility to the rectangle based on the presence or lack of values in an arbitrary column in SSRS. First doesn't work, because everything other than the first rectangle has NULL in the relevant columns on the first row. Count doesn't work because the rectangle isn't actually hooked to data. What I'm looking for is something like a WHERE clause (=Count() where type = "ab" or something). Like I said, I can go with the tablix route. But the broader scope of this is the ability to control the presence on the report of various items based on the results that have been returned.

Network node highlighting with Crossfilter

I have a graph with a network and a few histograms.
For the network, each node has a few properties with continuous value. The histograms are for node properties. Is there an easy way to highlight the node in the network, when users brush the histogram? Could I bind a dimension of the network data to the node class attribute "selectednode"?
I have checked dc.js, but it seems not support network graph.
Thanks
Crossfilter isn't really built for highlighting, as filtering will remove the data outside the filter from the view of other dimensions and groups. It sounds like you don't want unselected network nodes to disappear, but rather want nodes with property values falling within the selection to be highlighted. I'd build either your histogram or your network directly based on unfiltered data (not based on the Crossfilter) and then whenever the brush event happens, re-render the network nodes, checking the current brush extent against the property values.
How about two crossfilters built from the same records? The filtering one (cfFilt) would work as expected with dimensions for everything that can be filtered. The highlighting filter (cfHigh) would have one dimension (based on a record id or an identity function, d=>d) that is filtered by inclusion in cfFilt.groupAll(), plus dimensions that filter anything that can be highlighted. (cfFilt().groupAll().reduce() will need to return records, not counts. I can say how in comments if anyone needs to know.)
So cfHigh.groupAll() returns the records that pass through all the filtering and all the highlighting.
An interesting (and otherwise hard to achieve) consequence of this approach is that if you highlight something, then a filter makes that thing disappear, and then that filter is removed and the thing comes back, it will stay highlighted as long as nothing came along to change the highlighting filter in the meantime.

Change icon of markercluster depending on marker type inside the cluster

I have a map with markers of at this time two different types: photos and blog posts. I would like to use a clustering system, preferably MarkerClusterer.
Is there a way to change the marker icon dynamically, or in other words, depending on what kinds of marker (photos or posts) are inside the cluster? For example, if the cluster only consists of photos, I would like to display some sort of camera icon, if there are only posts inside the cluster, I might want to display a letter. And if all types of markers are inside the cluster, I would like to use some sort of combined icon.
Can I somehow insert this check where I assign the URL of the icon in MarkerStyleOptions?
A bonus would be to also display the amount of markers of each type in the icon, i.e. two numbers.
Does anyone see a way to do this without having to change the source code?
I guess the simplest option is to keep each marker type in a seperate clusters ...
You must create a different array of marker for each group that you created. And try to create a MarkerCluster for each one.

Automatic selection of control points in Matlab

Is there a way to select the control points automatically in Matlab instead of manually selecting them by cpselect? Thank you very much.
I just recently worked on a project where I had to do the same thing -- eventually I found that you can select control points automatically, but only if you use automatic selection to find the control points for both the unregistered and the orthophoto. (The control points used to define image transforms are stored in matrices, so if you can get your automated system to output a set of point coordinates in matrix form you can pass them to straight to cp2tform and bypass cpselect entirely.) On the other hand, cpselect stores corresponding pairs of image points using some kind of special data structure, so that I was never able to just pass it a set of control points for one image while leaving the other image blank.
I don't have the Matlab Image Processing Toolbox, but I see from the documentation that cpeselect can be called with an argument specifying the initial set of control points. Can you reduce your task to automating the creation of that initial set?

Resources