Skip to main content

I’m trying to create a custom shape that only has two link points, similar to “DC Voltage Source 1” in the “Circuit Diagrams” → “Power Sources” library.  Link points are circled in green.
 


When I try to create a custom shape, I can add link points just fine.  There are two below in my custom shape in the corners (because I am debugging right now), and they are circled in green.  These appear when I am drawing a line.

 

 

The trouble is, there are four points that show up by default, and I can’t figure out how to get rid of them.  They behave differently from the link points above and show up whenever I hover the cursor over my custom shape.

What are these four default points, and how can I modify the custom shape definition to remove them?  The “DC Voltage Source 1” shape from Lucid’s library doesn’t have them, so it must be possible.  I just can’t figure it out from the documentation.

 

Here’s “library.manifest” for my custom shape:

{
"name": "Electrical Symbols",
"shapes": "
{
"shape": "diode",
"name": "Diode",
"defaults": {
"width": 40,
"height": 20
}
}
]
}

Here’s “diode.shape” for my custom shape:

{
properties: c],
locked: j'aspectRatio'],
style: {
fill: { type: 'color', color: '#00000000' },
stroke: { color: '#000000', width: 2},
rounding: 0
},
geometry:
{
type: 'path'
path: 'M 0 0.5 L 1 0.5'
},
{
type: 'path',
"path": 'M 0.25 0 L 0.25 1 L 0.75 0.5 Z'
},
{
'type': 'path',
'path': 'M 0.75 0 L 0.75 1'
}
],
linkpoints:
{x: 0, y: 0},
{x: 1, y: 1}
],
bounds: {
x: 0.5,
y: 0.5,
w: 1.0,
h: 1.0,
anchor: 'center',
absolute: 'false'
}
}

Thanks,

Ben

 

 

Hello Ben, 

Sorry for the slow reply. I am reviewing your question now and will be in touch with any suggestions.


Hello Ben!

 

Unfortunately, those 4 link points are baked into all custom shapes. Although, note that these 4 points are just link points with added functionality. So, when drawing a line, you should be able to work with them just as you would a custom link point. They also allow you to draw lines from those points, and that is why you see them when hovering over the shape. Let me know if you have any other questions!

 

Connor


Some of the shapes available to me, such as “DC Voltage Source 1” in the “Circuit Diagrams” → “Power Sources” library, don’t have these extra four link points.  Are those shapes created by a different mechanism than custom shapes libraries?

 

It’s ok if that’s the case.  I was just assuming all shapes were made the same way and that there was a data field I could put in the JSON (maybe in the shape properties or in the manifest) that would remove the automatically generated link points.


Our shapes have a separate internal system as to how they are constructed, and the custom shape framework just connects to this system via LCSZ files (shape definitions, library manifests), so there are a few things that the custom shape framework is not able to achieve.


Reply